Skip to content

Commit

Permalink
Also send unseenCountForIcon during initial fetch
Browse files Browse the repository at this point in the history
  • Loading branch information
sirbrillig committed Jun 5, 2017
1 parent 8273503 commit 2eb2c9b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions components/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ class App extends React.Component {
);
}
if ( ! lastSuccessfulCheck ) {
const unseenCountForIcon = offline ? 1 : errors.length;
debug( 'sending unseenCountForIcon', unseenCountForIcon );
ipcRenderer.send( 'unread-notifications-count', unseenCountForIcon );
return el( 'main', null,
el( Header, { offline, fetchNotifications, openUrl, getSecondsUntilNextFetch, showConfig } ),
el( ErrorsArea, { errors, clearErrors } ),
Expand All @@ -85,6 +88,7 @@ class App extends React.Component {
const readNotes = this.getReadNotifications();
const unseenNotes = this.getUnseenNotifications();
const unseenCountForIcon = offline ? 1 : ( errors.length || unseenNotes.length );
debug( 'sending unseenCountForIcon', unseenCountForIcon );
ipcRenderer.send( 'unread-notifications-count', unseenCountForIcon );
return el( 'main', null,
el( Header, { offline, fetchNotifications, openUrl, lastSuccessfulCheck, showConfig, getSecondsUntilNextFetch } ),
Expand Down

0 comments on commit 2eb2c9b

Please sign in to comment.