Skip to content
Snippets Groups Projects
Commit c07f999f authored by Benoit Lavenier's avatar Benoit Lavenier
Browse files

[fix] Distinguish notification time, between utc time and medianTime (with an offset)

parent b22d9411
No related branches found
No related tags found
No related merge requests found
...@@ -75,8 +75,7 @@ function NotificationsController($scope, $ionicPopover, $state, $timeout, UIUtil ...@@ -75,8 +75,7 @@ function NotificationsController($scope, $ionicPopover, $state, $timeout, UIUtil
return $scope.showHome(); return $scope.showHome();
} }
$scope.loadWallet({ wallet.login({
wallet: wallet,
minData: true minData: true
}) })
.then(function() { .then(function() {
......
...@@ -43,12 +43,14 @@ function EsNotification(json, markAsReadCallback) { ...@@ -43,12 +43,14 @@ function EsNotification(json, markAsReadCallback) {
that.avatarIcon = 'ion-person'; that.avatarIcon = 'ion-person';
that.icon = 'ion-information-circled positive'; that.icon = 'ion-information-circled positive';
that.state = 'app.view_wallet'; that.state = 'app.view_wallet';
that.medianTime = that.time;
} }
// TX // TX
else if (json.code.startsWith('TX_')) { else if (json.code.startsWith('TX_')) {
that.avatarIcon = 'ion-card'; that.avatarIcon = 'ion-card';
that.icon = (json.code == 'TX_SENT') ? 'ion-paper-airplane dark' : 'ion-archive balanced'; 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; pubkeys = json.params.length > 0 ? json.params[0] : null;
if (pubkeys && pubkeys.indexOf(',') == -1) { if (pubkeys && pubkeys.indexOf(',') == -1) {
that.pubkey = pubkeys; that.pubkey = pubkeys;
...@@ -62,6 +64,7 @@ function EsNotification(json, markAsReadCallback) { ...@@ -62,6 +64,7 @@ function EsNotification(json, markAsReadCallback) {
that.avatarIcon = (json.code == 'CERT_RECEIVED') ? 'ion-ribbon-b' : 'ion-ribbon-a'; 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.icon = (json.code == 'CERT_RECEIVED') ? 'ion-ribbon-b balanced' : 'ion-ribbon-a gray';
that.pubkey = json.params.length > 0 ? json.params[0] : null; that.pubkey = json.params.length > 0 ? json.params[0] : null;
that.medianTime = that.time;
that.state = 'app.wallet_cert'; that.state = 'app.wallet_cert';
that.stateParams = { that.stateParams = {
type: (json.code == 'CERT_RECEIVED') ? 'received' : 'given' type: (json.code == 'CERT_RECEIVED') ? 'received' : 'given'
......
...@@ -10,10 +10,14 @@ ...@@ -10,10 +10,14 @@
<i ng-if="notification.avatar" class="item-image avatar" style="background-image: url({{::notification.avatar.src}})"></i> <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> <h3 trust-as-html="notification.message | translate:(notification.messageParams||notification)"></h3>
<h4> <h4 ng-if="!notification.medianTime">
<i class="icon {{notification.icon}}"></i>&thinsp;<span class="dark">{{notification.time|formatFromNow}}</span> <i class="icon {{notification.icon}}"></i>&thinsp;<span class="dark">{{notification.time|formatFromNow}}</span>
<span class="gray">| {{notification.time|formatDate}}</span> <span class="gray">| {{notification.time|formatDate}}</span>
</h4> </h4>
<h4 ng-if="notification.medianTime">
<i class="icon {{notification.icon}}"></i>&thinsp;<span class="dark">{{notification.medianTime|medianFromNow}}</span>
<span class="gray">| {{notification.medianTime|medianDate}}</span>
</h4>
</ion-item> </ion-item>
</ion-list> </ion-list>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment