Disabling unnecessary online/offline events for mobile/desktop
This commit is contained in:
parent
210774a1e0
commit
a2f2451ad9
2 changed files with 13 additions and 17 deletions
|
|
@ -26,12 +26,6 @@ angular.element(document).ready(function() {
|
||||||
}, 100);
|
}, 100);
|
||||||
}, false);
|
}, false);
|
||||||
|
|
||||||
// We are not emitting here, since when the BWS socket reconnects,
|
|
||||||
// update will be triggered
|
|
||||||
document.addEventListener('offline', function() {
|
|
||||||
window.location = '#/cordova/offline';
|
|
||||||
}, false);
|
|
||||||
|
|
||||||
// Back button event
|
// Back button event
|
||||||
document.addEventListener('backbutton', function() {
|
document.addEventListener('backbutton', function() {
|
||||||
var loc = window.location;
|
var loc = window.location;
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
angular.module('copayApp.services')
|
angular.module('copayApp.services')
|
||||||
.factory('profileService', function profileServiceFactory($rootScope, $location, $timeout, $filter, $log, lodash, storageService, bwcService, configService, notificationService, isChromeApp, isCordova, gettext) {
|
.factory('profileService', function profileServiceFactory($rootScope, $location, $timeout, $filter, $log, lodash, storageService, bwcService, configService, notificationService, isChromeApp, isCordova, gettext, nodeWebkit) {
|
||||||
|
|
||||||
var root = {};
|
var root = {};
|
||||||
|
|
||||||
|
|
@ -62,18 +62,20 @@ angular.module('copayApp.services')
|
||||||
client.removeAllListeners();
|
client.removeAllListeners();
|
||||||
|
|
||||||
|
|
||||||
client.on('reconnect', function() {
|
if (!nodeWebkit.isDefined() && !isCordova) {
|
||||||
if (root.focusedClient.credentials.walletId == client.credentials.walletId) {
|
client.on('reconnect', function() {
|
||||||
$rootScope.$emit('Local/Online');
|
if (root.focusedClient.credentials.walletId == client.credentials.walletId) {
|
||||||
}
|
$rootScope.$emit('Local/Online');
|
||||||
});
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
client.on('reconnecting', function() {
|
client.on('reconnecting', function() {
|
||||||
if (root.focusedClient.credentials.walletId == client.credentials.walletId) {
|
if (root.focusedClient.credentials.walletId == client.credentials.walletId) {
|
||||||
$rootScope.$emit('Local/Offline');
|
$rootScope.$emit('Local/Offline');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
client.on('notification', function(n) {
|
client.on('notification', function(n) {
|
||||||
$log.debug('BWC Notification:', n);
|
$log.debug('BWC Notification:', n);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue