-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Maintain grayed out chats with multiple offline splits #13602
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
9cf2a5a
Use existing pending chat field vs clearing it
neil-marcellini c9faf0f
Give optimistic created report actions a list key
neil-marcellini c9647b6
Merge branch 'main' into neil-fix-offline-split
neil-marcellini ea2ce75
Always sort created report actions first
neil-marcellini 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -267,9 +267,13 @@ function createSplitsAndOnyxData(participants, currentUserLogin, amount, comment | |
groupChatReport.lastReadTimestamp = Date.now(); | ||
groupChatReport.lastMessageText = groupIOUReportAction.message[0].text; | ||
groupChatReport.lastMessageHtml = groupIOUReportAction.message[0].html; | ||
groupChatReport.pendingFields = { | ||
createChat: existingGroupChatReport ? null : CONST.RED_BRICK_ROAD_PENDING_ACTION.ADD, | ||
}; | ||
|
||
// If we have an existing groupChatReport use it's pending fields, otherwise indicate that we are adding a chat | ||
if (!existingGroupChatReport) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good catch. |
||
groupChatReport.pendingFields = { | ||
createChat: CONST.RED_BRICK_ROAD_PENDING_ACTION.ADD, | ||
}; | ||
} | ||
|
||
const optimisticData = [ | ||
{ | ||
|
@@ -379,9 +383,11 @@ function createSplitsAndOnyxData(participants, currentUserLogin, amount, comment | |
oneOnOneChatReport.lastReadSequenceNumber = oneOnOneChatReportMaxSequenceNumber + 1; | ||
oneOnOneChatReport.lastMessageText = oneOnOneIOUReportAction.message[0].text; | ||
oneOnOneChatReport.lastMessageHtml = oneOnOneIOUReportAction.message[0].html; | ||
oneOnOneChatReport.pendingFields = { | ||
createChat: existingOneOnOneChatReport ? null : CONST.RED_BRICK_ROAD_PENDING_ACTION.ADD, | ||
}; | ||
if (!existingOneOnOneChatReport) { | ||
oneOnOneChatReport.pendingFields = { | ||
createChat: CONST.RED_BRICK_ROAD_PENDING_ACTION.ADD, | ||
}; | ||
} | ||
|
||
optimisticData.push( | ||
{ | ||
|
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.
This is already being discussed here #13310 is not a priority for now. So maybe we can just focus on greying out the LHN.
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 added a
reportActionID
to created report actions to fix a console error where the report action item in the list was missing a key (the reportActionID). As a result of that change the created messages would appear after the IOU message because they have the samecreated
timestamp. Adding this condition fixes that issue and helps with the ordering so I would like to keep the change.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.
NAB from my end. But I guess we will anyhow need to clean the sort method because reportActions would be random now, right?