Reload copay after saves preferences

This commit is contained in:
Gustavo Maximiliano Cortez 2015-04-17 13:01:02 -03:00
commit cb6298c4b0

View file

@ -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);
}
} }
}; };