Skip to content

Commit

Permalink
Fix/only run notes loaded when notes loaded (#1680)
Browse files Browse the repository at this point in the history
* Only run notesLoaded when notes are indeed loaded

After querying the noteBucket we run notes loaded with an empty notes array. This causes havoc because we rely on notes being null until notes are loaded. This commit adds a check to ensure there is at least one note before running notesLoaded

* Add release notes

* Update RELEASE-NOTES.txt
  • Loading branch information
belcherj committed Oct 30, 2019
1 parent e1c7565 commit da7eac7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions RELEASE-NOTES.txt
Expand Up @@ -13,6 +13,7 @@

- Rework WordPress.com signin to prevent infinite looping and login failures [#1627](https://github.com/Automattic/simplenote-electron/pull/1627)
- Update link to release-notes in updater config: CHANGELOG -> RELEASE_NOTES
- Stop showing that there are no notes when initially loading notes from the server. [#1680](https://github.com/Automattic/simplenote-electron/pull/1680)

## [v1.9.1]

Expand Down
4 changes: 3 additions & 1 deletion lib/flux/app-state.js
Expand Up @@ -266,7 +266,9 @@ export const actionMap = new ActionMap({
cursor.continue();
} else {
debug(`noteCount: ${notes.length}`);
dispatch(this.action('notesLoaded', { notes: notes }));
if (notes.length) {
dispatch(this.action('notesLoaded', { notes: notes }));
}
}
};
});
Expand Down

0 comments on commit da7eac7

Please sign in to comment.