Skip to content
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

fix: 30839 All of the IOU chats disappear when I do the same IOU and turn the connection on #31903

Merged
merged 1 commit into from
Dec 4, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/pages/home/report/ReportActionsView.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,9 @@ function ReportActionsView(props) {
const isReportFullyVisible = useMemo(() => getIsReportFullyVisible(isFocused), [isFocused]);

const openReportIfNecessary = () => {
const createChatError = _.get(props.report, ['errorFields', 'createChat']);
// If the report is optimistic (AKA not yet created) we don't need to call openReport again
if (props.report.isOptimisticReport) {
if (props.report.isOptimisticReport || !_.isEmpty(createChatError)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I just noticed there's already an isOptimisticReport field. Would it be better to set isOptimisticReport to true when creating an optimistic report instead of adding the condition for errorFields? I see that some places are setting it this way.

isOptimisticReport: true,

isOptimisticReport: false,

Please feel free to let me know if you have some different thoughts. :)
cc @nkuoch

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree that we can set isOptimisticReport to true

Pros: Setting isOptimisticReport for consistency

Cons: We have to update many places. We already set errorFields so we just need to make the small change.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What should we do? @ntdiary @nkuoch

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tienifr, I think the current implementation is ok. We just need to add some details based on the comment below. :)

return;
}

Expand Down
Loading