Skip to content

Commit

Permalink
Merge pull request #54180 from truph01/fix/54660
Browse files Browse the repository at this point in the history
fix: Skeleton is displayed when create offline Room in focus mode and switch
  • Loading branch information
lakchote authored Jan 3, 2025
2 parents 182cab7 + b7a690b commit 04cd7b0
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
14 changes: 14 additions & 0 deletions src/libs/actions/Report.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2359,6 +2359,13 @@ function addPolicyReport(policyReport: ReportUtils.OptimisticChatReport) {
key: ONYXKEYS.FORMS.NEW_ROOM_FORM,
value: {isLoading: true},
},
{
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.REPORT_METADATA}${policyReport.reportID}`,
value: {
isOptimisticReport: true,
},
},
];
const successData: OnyxUpdate[] = [
{
Expand Down Expand Up @@ -2407,6 +2414,13 @@ function addPolicyReport(policyReport: ReportUtils.OptimisticChatReport) {
key: ONYXKEYS.FORMS.NEW_ROOM_FORM,
value: {isLoading: false},
},
{
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.REPORT_METADATA}${policyReport.reportID}`,
value: {
isOptimisticReport: false,
},
},
];

const parameters: AddWorkspaceRoomParams = {
Expand Down
2 changes: 1 addition & 1 deletion src/pages/home/ReportScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ function ReportScreen({route, currentReportID = '', navigation}: ReportScreenPro
!isCurrentReportLoadedFromOnyx ||
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
(deleteTransactionNavigateBackUrl && ReportUtils.getReportIDFromLink(deleteTransactionNavigateBackUrl) === report?.reportID) ||
isLoading;
(!reportMetadata.isOptimisticReport && isLoading);

const isLinkedActionBecomesDeleted = prevIsLinkedActionDeleted !== undefined && !prevIsLinkedActionDeleted && isLinkedActionDeleted;

Expand Down

0 comments on commit 04cd7b0

Please sign in to comment.