Load chats when handling browser notifications. Fix initial sign in bug.#339
Merged
Load chats when handling browser notifications. Fix initial sign in bug.#339
Conversation
tgolen
requested changes
Aug 28, 2020
| */ | ||
| function fetchChatReports() { | ||
| return queueRequest('Get', {returnValueList: 'chatList'}) | ||
| .then(({chatList}) => fetchChatReportsByIDs(String(chatList).split(','))); |
Contributor
There was a problem hiding this comment.
Why is it necessary to cast this to a string?
Contributor
Author
There was a problem hiding this comment.
It's because rvl=chatList returns an int when there's only one chat and calling .split() on a Number doesn't work. Can probably handle this a different way, but imagining that we'll change the way we fetch chats in the future.
Contributor
There was a problem hiding this comment.
Oh, that's good to know! That would be another good thing to add as a comment in the code. It could bite someone.
| throw new Error('report does not exist in the store, so ignoring new comments'); | ||
| } | ||
|
|
||
| if (!ionReportID) { |
Contributor
There was a problem hiding this comment.
Could you please add a comment here to explain how it gets into this situation?
Contributor
Author
|
Updated |
tgolen
approved these changes
Aug 28, 2020
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes:
#334
#316
Tests:
Testing first sign in
localStorageTesting a new chat report notification will add the chat to your LHN if it doesn't exist
Apply this diff or run the app in production mode
API.createChatReport({emailList:'address1,address2'})