Spinner for join camera
This commit is contained in:
parent
783d562c9c
commit
e3079fa35d
1 changed files with 26 additions and 20 deletions
|
|
@ -8,26 +8,32 @@ angular.module('copayApp.controllers').controller('joinController',
|
||||||
//TODO : make one function - this was copied from topbar.js
|
//TODO : make one function - this was copied from topbar.js
|
||||||
var cordovaOpenScanner = function() {
|
var cordovaOpenScanner = function() {
|
||||||
window.ignoreMobilePause = true;
|
window.ignoreMobilePause = true;
|
||||||
cordova.plugins.barcodeScanner.scan(
|
window.plugins.spinnerDialog.show(null, 'Preparing camera...', true);
|
||||||
function onSuccess(result) {
|
$timeout(function() {
|
||||||
$timeout(function() {
|
cordova.plugins.barcodeScanner.scan(
|
||||||
window.ignoreMobilePause = false;
|
function onSuccess(result) {
|
||||||
}, 100);
|
$timeout(function() {
|
||||||
if (result.cancelled) return;
|
window.plugins.spinnerDialog.hide();
|
||||||
|
window.ignoreMobilePause = false;
|
||||||
|
}, 100);
|
||||||
|
if (result.cancelled) return;
|
||||||
|
|
||||||
$timeout(function() {
|
$timeout(function() {
|
||||||
var data = result.text;
|
var data = result.text;
|
||||||
$scope.secret = data;
|
$scope.secret = data;
|
||||||
$scope.joinForm.secret.$setViewValue(data);
|
$scope.joinForm.secret.$setViewValue(data);
|
||||||
$scope.joinForm.secret.$render();
|
$scope.joinForm.secret.$render();
|
||||||
}, 1000);
|
}, 1000);
|
||||||
},
|
},
|
||||||
function onError(error) {
|
function onError(error) {
|
||||||
$timeout(function() {
|
$timeout(function() {
|
||||||
window.ignoreMobilePause = false;
|
window.ignoreMobilePause = false;
|
||||||
}, 100);
|
window.plugins.spinnerDialog.hide();
|
||||||
alert('Scanning error');
|
}, 100);
|
||||||
});
|
alert('Scanning error');
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}, 100);
|
||||||
};
|
};
|
||||||
|
|
||||||
var modalOpenScanner = function() {
|
var modalOpenScanner = function() {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue