Fixes restart desktop application

This commit is contained in:
Gustavo Maximiliano Cortez 2015-06-11 16:30:21 -03:00
parent be6c132fbc
commit 36b6efa9e4
No known key found for this signature in database
GPG Key ID: 15EDAD8D9F2EB1AF
1 changed files with 12 additions and 2 deletions

View File

@ -1,6 +1,6 @@
'use strict';
angular.module('copayApp.services')
.factory('applicationService', function($rootScope, $timeout, isCordova, isChromeApp) {
.factory('applicationService', function($rootScope, $timeout, isCordova, isChromeApp, nodeWebkit, go) {
var root = {};
root.restart = function() {
@ -14,7 +14,17 @@ angular.module('copayApp.services')
} else {
// Go home reloading the application
if (isChromeApp) {
chrome.runtime.reload();
if (nodeWebkit.isDefined()) {
go.walletHome();
$timeout(function() {
var win = require('nw.gui').Window.get();
win.reload(3);
//or
win.reloadDev();
}, 100);
} else {
chrome.runtime.reload();
}
} else {
window.location = window.location.href.substr(0, hashIndex);
}