Fix reloading after restart app
This commit is contained in:
parent
1224f89c17
commit
9cebdbef42
3 changed files with 11 additions and 9 deletions
|
|
@ -21,8 +21,7 @@ angular.module('copayApp.controllers').controller('preferencesBwsUrlController',
|
||||||
configService.set(opts, function(err) {
|
configService.set(opts, function(err) {
|
||||||
if (err) console.log(err);
|
if (err) console.log(err);
|
||||||
$scope.$emit('Local/BWSUpdated');
|
$scope.$emit('Local/BWSUpdated');
|
||||||
applicationService.restart(true);
|
applicationService.restart();
|
||||||
go.walletHome();
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -108,14 +108,19 @@ angular
|
||||||
views: {
|
views: {
|
||||||
'main': {
|
'main': {
|
||||||
templateUrl: 'views/disclaimer.html',
|
templateUrl: 'views/disclaimer.html',
|
||||||
controller: function($scope, storageService, applicationService) {
|
controller: function($scope, $timeout, storageService, applicationService, go) {
|
||||||
storageService.getCopayDisclaimer(function(err, val) {
|
storageService.getCopayDisclaimer(function(err, val) {
|
||||||
$scope.agreed = val;
|
$scope.agreed = val;
|
||||||
|
$timeout(function(){
|
||||||
|
$scope.$digest();
|
||||||
|
}, 1);
|
||||||
});
|
});
|
||||||
|
|
||||||
$scope.agree = function() {
|
$scope.agree = function() {
|
||||||
storageService.setCopayDisclaimer(function(err) {
|
storageService.setCopayDisclaimer(function(err) {
|
||||||
applicationService.restart();
|
$timeout(function(){
|
||||||
|
applicationService.restart();
|
||||||
|
}, 1000);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,18 +3,16 @@ angular.module('copayApp.services')
|
||||||
.factory('applicationService', function($rootScope, $timeout, isCordova, isChromeApp) {
|
.factory('applicationService', function($rootScope, $timeout, isCordova, isChromeApp) {
|
||||||
var root = {};
|
var root = {};
|
||||||
|
|
||||||
root.restart = function(hard) {
|
root.restart = function() {
|
||||||
|
var hashIndex = window.location.href.indexOf('#/');
|
||||||
if (isCordova) {
|
if (isCordova) {
|
||||||
if (hard) {
|
window.location = window.location.href.substr(0, hashIndex);
|
||||||
location.reload();
|
|
||||||
}
|
|
||||||
$timeout(function() {
|
$timeout(function() {
|
||||||
$rootScope.$digest();
|
$rootScope.$digest();
|
||||||
}, 1);
|
}, 1);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
// Go home reloading the application
|
// Go home reloading the application
|
||||||
var hashIndex = window.location.href.indexOf('#/');
|
|
||||||
if (isChromeApp) {
|
if (isChromeApp) {
|
||||||
chrome.runtime.reload();
|
chrome.runtime.reload();
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue