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';
angular.module('copayApp.services')
.factory('applicationService', function($rootScope, $timeout, isCordova) {
.factory('applicationService', function($rootScope, $timeout, isCordova, isChromeApp) {
var root = {};
root.restart = function(hard) {
if (isCordova) {
$rootScope.iden = $rootScope.wallet = undefined;
if (hard) {
location.reload();
}
@ -15,8 +14,12 @@ angular.module('copayApp.services')
} else {
// Go home reloading the application
var hashIndex = window.location.href.indexOf('#!/');
window.location = window.location.href.substr(0, hashIndex);
var hashIndex = window.location.href.indexOf('#/');
if (isChromeApp) {
chrome.runtime.reload();
} else {
window.location = window.location.href.substr(0, hashIndex);
}
}
};