Skip to content

Commit 04cd7b0

Browse files
authored
Merge pull request #54180 from truph01/fix/54660
fix: Skeleton is displayed when create offline Room in focus mode and switch
2 parents 182cab7 + b7a690b commit 04cd7b0

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

src/libs/actions/Report.ts

+14
Original file line numberDiff line numberDiff line change
@@ -2359,6 +2359,13 @@ function addPolicyReport(policyReport: ReportUtils.OptimisticChatReport) {
23592359
key: ONYXKEYS.FORMS.NEW_ROOM_FORM,
23602360
value: {isLoading: true},
23612361
},
2362+
{
2363+
onyxMethod: Onyx.METHOD.MERGE,
2364+
key: `${ONYXKEYS.COLLECTION.REPORT_METADATA}${policyReport.reportID}`,
2365+
value: {
2366+
isOptimisticReport: true,
2367+
},
2368+
},
23622369
];
23632370
const successData: OnyxUpdate[] = [
23642371
{
@@ -2407,6 +2414,13 @@ function addPolicyReport(policyReport: ReportUtils.OptimisticChatReport) {
24072414
key: ONYXKEYS.FORMS.NEW_ROOM_FORM,
24082415
value: {isLoading: false},
24092416
},
2417+
{
2418+
onyxMethod: Onyx.METHOD.MERGE,
2419+
key: `${ONYXKEYS.COLLECTION.REPORT_METADATA}${policyReport.reportID}`,
2420+
value: {
2421+
isOptimisticReport: false,
2422+
},
2423+
},
24102424
];
24112425

24122426
const parameters: AddWorkspaceRoomParams = {

src/pages/home/ReportScreen.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ function ReportScreen({route, currentReportID = '', navigation}: ReportScreenPro
383383
!isCurrentReportLoadedFromOnyx ||
384384
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
385385
(deleteTransactionNavigateBackUrl && ReportUtils.getReportIDFromLink(deleteTransactionNavigateBackUrl) === report?.reportID) ||
386-
isLoading;
386+
(!reportMetadata.isOptimisticReport && isLoading);
387387

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

0 commit comments

Comments
 (0)