From c07f999f4cbf55164a8e792846c78d3dd7f682cf Mon Sep 17 00:00:00 2001 From: blavenie <benoit.lavenier@e-is.pro> Date: Tue, 18 Dec 2018 19:40:30 +0100 Subject: [PATCH] [fix] Distinguish notification time, between utc time and medianTime (with an offset) --- www/plugins/es/js/controllers/notification-controllers.js | 3 +-- www/plugins/es/js/entities/notification.js | 3 +++ .../es/templates/notification/list_notification.html | 6 +++++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/www/plugins/es/js/controllers/notification-controllers.js b/www/plugins/es/js/controllers/notification-controllers.js index 424b3b99..937b70d9 100644 --- a/www/plugins/es/js/controllers/notification-controllers.js +++ b/www/plugins/es/js/controllers/notification-controllers.js @@ -75,8 +75,7 @@ function NotificationsController($scope, $ionicPopover, $state, $timeout, UIUtil return $scope.showHome(); } - $scope.loadWallet({ - wallet: wallet, + wallet.login({ minData: true }) .then(function() { diff --git a/www/plugins/es/js/entities/notification.js b/www/plugins/es/js/entities/notification.js index 3350deab..f928c320 100644 --- a/www/plugins/es/js/entities/notification.js +++ b/www/plugins/es/js/entities/notification.js @@ -43,12 +43,14 @@ function EsNotification(json, markAsReadCallback) { that.avatarIcon = 'ion-person'; that.icon = 'ion-information-circled positive'; that.state = 'app.view_wallet'; + that.medianTime = that.time; } // TX else if (json.code.startsWith('TX_')) { that.avatarIcon = 'ion-card'; that.icon = (json.code == 'TX_SENT') ? 'ion-paper-airplane dark' : 'ion-archive balanced'; + that.medianTime = that.time; pubkeys = json.params.length > 0 ? json.params[0] : null; if (pubkeys && pubkeys.indexOf(',') == -1) { that.pubkey = pubkeys; @@ -62,6 +64,7 @@ function EsNotification(json, markAsReadCallback) { that.avatarIcon = (json.code == 'CERT_RECEIVED') ? 'ion-ribbon-b' : 'ion-ribbon-a'; that.icon = (json.code == 'CERT_RECEIVED') ? 'ion-ribbon-b balanced' : 'ion-ribbon-a gray'; that.pubkey = json.params.length > 0 ? json.params[0] : null; + that.medianTime = that.time; that.state = 'app.wallet_cert'; that.stateParams = { type: (json.code == 'CERT_RECEIVED') ? 'received' : 'given' diff --git a/www/plugins/es/templates/notification/list_notification.html b/www/plugins/es/templates/notification/list_notification.html index bab9c5ea..6b985155 100644 --- a/www/plugins/es/templates/notification/list_notification.html +++ b/www/plugins/es/templates/notification/list_notification.html @@ -10,10 +10,14 @@ <i ng-if="notification.avatar" class="item-image avatar" style="background-image: url({{::notification.avatar.src}})"></i> <h3 trust-as-html="notification.message | translate:(notification.messageParams||notification)"></h3> - <h4> + <h4 ng-if="!notification.medianTime"> <i class="icon {{notification.icon}}"></i> <span class="dark">{{notification.time|formatFromNow}}</span> <span class="gray">| {{notification.time|formatDate}}</span> </h4> + <h4 ng-if="notification.medianTime"> + <i class="icon {{notification.icon}}"></i> <span class="dark">{{notification.medianTime|medianFromNow}}</span> + <span class="gray">| {{notification.medianTime|medianDate}}</span> + </h4> </ion-item> </ion-list> -- GitLab