Fix: Join button missing in thread when parent report is loading#82608
Fix: Join button missing in thread when parent report is loading#82608yuzebin wants to merge 1 commit intoExpensify:mainfrom
Conversation
Removed unnecessary isParentReportLoading condition from Join button display logic. The canJoin check already handles all necessary conditions for displaying the button. Fixes Expensify#75264
|
I have read the CLA Document and I hereby sign the CLA Zebin Yu seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9dd9d61621
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| )} | ||
| {!shouldUseNarrowLayout && isOpenTaskReport(report, parentReportAction) && <TaskHeaderActionButton report={report} />} | ||
| {!isParentReportLoading && canJoin && !shouldUseNarrowLayout && joinButton} | ||
| {canJoin && !shouldUseNarrowLayout && joinButton} |
There was a problem hiding this comment.
Restore parent-load guard before rendering Join button
Removing the !isParentReportLoading gate makes Join visible while parent data is still unresolved, but canJoinChat() is not parent-independent: it only filters track-expense threads via isTrackExpenseReportNew(report, parentReport, parentReportAction), which returns false when parentReport is still missing, causing canJoinChat to fall through to isChatThread(report) and temporarily allow join on threads that should never be joinable. In direct-link/loading scenarios this can surface an incorrect Join action and allow users to trigger joinRoom before the parent report arrives.
Useful? React with 👍 / 👎.
|
I have read the CLA Document and I hereby sign the CLA |
|
@yuzebin We only accept PRs when a contributor has been specifically hired for a job. Please review our contributing guidelines for more details. I don't see that you were hired for a job related to this PR, so I am going to close it. Let me know if you have any questions. |
Problem
When User B opens a thread created by User A, the Join button doesn't appear if the parent report is still loading from Onyx.
Root Cause
The Join button display condition included !isParentReportLoading\ which blocked the button when parentReport was loading. However, the \canJoin\ check already contains all necessary logic to determine if the button should be shown.
Solution
Removed the unnecessary !isParentReportLoading