-
Notifications
You must be signed in to change notification settings - Fork 563
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Warn users when before signing out with unsynced notes #702
Merged
Merged
Changes from 9 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
7a9e28c
sign out warning, still a WIP
roundhill 721ae54
Adding a native dialog when on electron, otherwise a humble js `confi…
roundhill 8abc96d
Removing some now-unused css.
roundhill 7492903
Logging > Signing
roundhill 12fddee
Another update to `logging` vs `signing`.
roundhill 3192698
Adding support to check Simperium's new `hasLocalChanges` to see if t…
roundhill 9710609
Merge branch 'master' into add/signout-unsynced-prompt
roundhill f68b6eb
Changed an if statement to a ternary.
roundhill d56399e
Removing if statement, not needed with the callback in Simperium
roundhill 5324686
Use Promise.all so that we iterate through all notes until a rejectio…
roundhill File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Looks like I commented on an outdated change but the
Promise.race
remains.It seems you want to check if any of the notes have a version of
0
and if any of them do have a version of0
then you will want to showshowUnsyncedWarning
.Promise.race
will return the first promise that resolves or rejects and ignore all others where asPromise.all
will wait until all Promisesresolve
or fail early upon the firstreject
.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.
Hmm ok, I think I indeed want Promise.all then. If we ever see a version of zero we should stop and show the warning. Otherwise, keep checking.
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.
Updated in 5324686. Nice catch!
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.
good catch @beaucollins - the
race
was from my original idea where only the unsync'd notes would resolve and so we wouldn't have needed to wait for all Promises - an early abort. this was a wrong idea. 😄it would also work if we only
reject()
ed on unsync'd notes and had a timeout, but that's another kind of race we don't want.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.
I've learned a lot about
Promise
via this PR! :)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.
@roundhill you don't need to learn that much about promises. just let your "yes" be "yes" and your "no" be "no" 😉