Wallet/src/js/services/applicationService.js
Matias Alejo Garcia 320de62f13 bwc
2015-04-11 10:53:15 -03:00

24 lines
629 B
JavaScript

'use strict';
angular.module('copayApp.services')
.factory('applicationService', function($rootScope, $timeout, isCordova) {
var root = {};
root.restart = function(hard) {
if (isCordova) {
$rootScope.iden = $rootScope.wallet = undefined;
if (hard) {
location.reload();
}
$timeout(function() {
$rootScope.$digest();
}, 1);
} else {
// Go home reloading the application
var hashIndex = window.location.href.indexOf('#!/');
window.location = window.location.href.substr(0, hashIndex);
}
};
return root;
});