Merge pull request #2536 from cmgustavo/bug/reload-after-save-prefs
Reload copay after save preferences
This commit is contained in:
commit
beb9d5ca0c
1 changed files with 7 additions and 4 deletions
|
|
@ -1,11 +1,10 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
angular.module('copayApp.services')
|
angular.module('copayApp.services')
|
||||||
.factory('applicationService', function($rootScope, $timeout, isCordova) {
|
.factory('applicationService', function($rootScope, $timeout, isCordova, isChromeApp) {
|
||||||
var root = {};
|
var root = {};
|
||||||
|
|
||||||
root.restart = function(hard) {
|
root.restart = function(hard) {
|
||||||
if (isCordova) {
|
if (isCordova) {
|
||||||
$rootScope.iden = $rootScope.wallet = undefined;
|
|
||||||
if (hard) {
|
if (hard) {
|
||||||
location.reload();
|
location.reload();
|
||||||
}
|
}
|
||||||
|
|
@ -15,8 +14,12 @@ angular.module('copayApp.services')
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
// Go home reloading the application
|
// Go home reloading the application
|
||||||
var hashIndex = window.location.href.indexOf('#!/');
|
var hashIndex = window.location.href.indexOf('#/');
|
||||||
window.location = window.location.href.substr(0, hashIndex);
|
if (isChromeApp) {
|
||||||
|
chrome.runtime.reload();
|
||||||
|
} else {
|
||||||
|
window.location = window.location.href.substr(0, hashIndex);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue