fix focus wallet tapping on notification
This commit is contained in:
parent
4fd45ca83e
commit
08c9e81f9b
1 changed files with 28 additions and 0 deletions
|
|
@ -49,6 +49,34 @@ angular.module('copayApp.controllers').controller('indexController', function($r
|
||||||
ret.tab = 'walletHome';
|
ret.tab = 'walletHome';
|
||||||
var vanillaScope = ret;
|
var vanillaScope = ret;
|
||||||
|
|
||||||
|
if (ret.usePushNotifications) {
|
||||||
|
// Listening for push notifications
|
||||||
|
var push = PushNotification.init(configService.getDefaults().pushNotifications.config);
|
||||||
|
|
||||||
|
push.on('notification', function(data) {
|
||||||
|
if (!data.additionalData.foreground) {
|
||||||
|
window.ignoreMobilePause = true;
|
||||||
|
// window.plugins.spinnerDialog.show(null, gettextCatalog.getString('LOADING...'), true);
|
||||||
|
$log.debug('Push notification event: ', data.message);
|
||||||
|
|
||||||
|
$timeout(function() {
|
||||||
|
var wallets = profileService.getWallets();
|
||||||
|
var walletToFind = data.additionalData.walletId;
|
||||||
|
|
||||||
|
var walletFound = lodash.find(wallets, function(w) {
|
||||||
|
return (lodash.isEqual(walletToFind, sjcl.hash.sha256.hash(w.id)));
|
||||||
|
});
|
||||||
|
|
||||||
|
if (!walletFound) return $log.debug('Wallet not found');
|
||||||
|
profileService.setAndStoreFocus(walletFound.id, function() {
|
||||||
|
// $timeout(function() {
|
||||||
|
// window.plugins.spinnerDialog.hide();
|
||||||
|
// }, 200);
|
||||||
|
});
|
||||||
|
}, 100);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
function strip(number) {
|
function strip(number) {
|
||||||
return (parseFloat(number.toPrecision(12)));
|
return (parseFloat(number.toPrecision(12)));
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue