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
Branches issue_780
Tags
No related merge requests found
......@@ -75,8 +75,7 @@ function NotificationsController($scope, $ionicPopover, $state, $timeout, UIUtil
return $scope.showHome();
}
$scope.loadWallet({
wallet: wallet,
wallet.login({
minData: true
})
.then(function() {
......
......@@ -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'
......
......@@ -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>&thinsp;<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>&thinsp;<span class="dark">{{notification.medianTime|medianFromNow}}</span>
<span class="gray">| {{notification.medianTime|medianDate}}</span>
</h4>
</ion-item>
</ion-list>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment