-
Notifications
You must be signed in to change notification settings - Fork 168
List only 1 'syncing to chain' ntfn #458
Conversation
src/action/notification.js
Outdated
| handlerLbl: handlerLbl || (err ? 'Show error logs' : null), | ||
| display: true, | ||
| }); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This action should probably not need to be changed. Either we call notification.display only once in the info action (problem is we want the notification bar to stay visible, so this won't work) or we filter the notification list to render the syncing info only once. Both aren't really solutions I'm happy with. Thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tanx I think it would make sense to modify computedNotifications to filter the notification list such that Syncing to chain... notifications are limited to once every 5 minutes . I'd also be fine with only showing it once. what do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Showing it once is fine. Filtering in computedNotifications makes sense. Something like...
const all = [];
notifications.forEach(n => {
if (n.waiting && all.find(a => a.waiting)) {
return;
}
all.push(n);
});
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We only use the waiting flag for syncing so that should do the job.
tanx
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@valentinewallace I reverted the previous change and filtered in ComputedNotification like we discussed. Good to merge from my side. Let me know what you think.
| return; | ||
| } | ||
| all.push(n); | ||
| }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This displays only the first waiting notification.
| }), | ||
| notificationCountLabel: computed(() => | ||
| formatNumber(store.computedNotifications.length) | ||
| ), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also moved this here to be computed based on the computedNotifications list size.
0854f9c to
4d9438f
Compare
| date: new Date(1528703821406), | ||
| display: true, | ||
| }); | ||
| store.notifications.push({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Went in to add this test, I see you've already added it 💯
|
Everything great, tested packaged app & looks good :) I rebased onto master, I think that's still OK to merge? Made sure to test it out & everything. |
Closes #456