Skip to content
This repository was archived by the owner on Feb 23, 2021. It is now read-only.

Conversation

@valentinewallace
Copy link
Contributor

Closes #456

@valentinewallace valentinewallace self-assigned this Jul 17, 2018
@valentinewallace valentinewallace requested a review from tanx July 17, 2018 23:29
handlerLbl: handlerLbl || (err ? 'Show error logs' : null),
display: true,
});
}
Copy link
Contributor

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?

Copy link
Contributor Author

@valentinewallace valentinewallace Jul 23, 2018

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?

Copy link
Contributor

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);
});

Copy link
Contributor

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.

Copy link
Contributor

@tanx tanx left a 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);
});
Copy link
Contributor

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)
),
Copy link
Contributor

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.

@valentinewallace valentinewallace force-pushed the list-single-syncing-ntfn branch from 0854f9c to 4d9438f Compare July 24, 2018 23:32
date: new Date(1528703821406),
display: true,
});
store.notifications.push({
Copy link
Contributor Author

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 💯

@valentinewallace
Copy link
Contributor Author

valentinewallace commented Jul 24, 2018

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.

@valentinewallace valentinewallace merged commit 38100c6 into master Jul 24, 2018
@valentinewallace valentinewallace deleted the list-single-syncing-ntfn branch July 24, 2018 23:43
@valentinewallace valentinewallace restored the list-single-syncing-ntfn branch July 25, 2018 08:09
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants