fix spinner in windows phone

This commit is contained in:
Gabriel 2017-03-30 21:37:12 +02:00
commit f677d4bd75
3 changed files with 43 additions and 38 deletions

View file

@ -211,6 +211,6 @@ angular.module('copayApp.controllers').controller('createController',
}, 100); }, 100);
} else $state.go('tabs.home'); } else $state.go('tabs.home');
}); });
}, 100); }, 300);
} }
}); });

View file

@ -43,6 +43,7 @@ angular.module('copayApp.controllers').controller('tourController',
var retryCount = 0; var retryCount = 0;
$scope.createDefaultWallet = function() { $scope.createDefaultWallet = function() {
ongoingProcess.set('creatingWallet', true); ongoingProcess.set('creatingWallet', true);
$timeout(function() {
profileService.createDefaultWallet(function(err, walletClient) { profileService.createDefaultWallet(function(err, walletClient) {
if (err) { if (err) {
$log.warn(err); $log.warn(err);
@ -75,6 +76,7 @@ angular.module('copayApp.controllers').controller('tourController',
}); });
} }
}); });
}, 300);
}; };
$scope.goBack = function() { $scope.goBack = function() {

View file

@ -3,6 +3,7 @@
angular.module('copayApp.services').factory('ongoingProcess', function($log, $timeout, $filter, lodash, $ionicLoading, gettext, platformInfo) { angular.module('copayApp.services').factory('ongoingProcess', function($log, $timeout, $filter, lodash, $ionicLoading, gettext, platformInfo) {
var root = {}; var root = {};
var isCordova = platformInfo.isCordova; var isCordova = platformInfo.isCordova;
var isWP = platformInfo.isWP;
var ongoingProcess = {}; var ongoingProcess = {};
@ -49,7 +50,7 @@ angular.module('copayApp.services').factory('ongoingProcess', function($log, $ti
root.clear = function() { root.clear = function() {
ongoingProcess = {}; ongoingProcess = {};
if (isCordova) { if (isCordova && !isWP) {
window.plugins.spinnerDialog.hide(); window.plugins.spinnerDialog.hide();
} else { } else {
$ionicLoading.hide(); $ionicLoading.hide();
@ -79,17 +80,19 @@ angular.module('copayApp.services').factory('ongoingProcess', function($log, $ti
if (customHandler) { if (customHandler) {
customHandler(processName, showName, isOn); customHandler(processName, showName, isOn);
} else if (root.onGoingProcessName) { } else if (root.onGoingProcessName) {
if (isCordova) { if (isCordova && !isWP) {
window.plugins.spinnerDialog.show(null, showName, root.clear); window.plugins.spinnerDialog.show(null, showName, root.clear);
} else { } else {
var tmpl = '<div class="item-icon-left">' + showName + '<ion-spinner class="spinner-stable" icon="lines"></ion-spinner></div>'; var tmpl;
if (isWP) tmpl = '<div>' + showName +'</div>';
else tmpl = '<div class="item-icon-left">' + showName + '<ion-spinner class="spinner-stable" icon="lines"></ion-spinner></div>';
$ionicLoading.show({ $ionicLoading.show({
template: tmpl template: tmpl
}); });
} }
} else { } else {
if (isCordova) { if (isCordova && !isWP) {
window.plugins.spinnerDialog.hide(); window.plugins.spinnerDialog.hide();
} else { } else {
$ionicLoading.hide(); $ionicLoading.hide();