Merge pull request #2536 from cmgustavo/bug/reload-after-save-prefs

Reload copay after save preferences
This commit is contained in:
Matias Alejo Garcia 2015-04-17 13:03:46 -03:00
commit beb9d5ca0c

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