Skip to content

Commit

Permalink
Merge pull request #36702 from tienifr/fix/34910
Browse files Browse the repository at this point in the history
fix: Distance request preview in the main chat is grayed out offline when created online
  • Loading branch information
iwiznia authored Feb 19, 2024
2 parents 85356ce + 2b9224c commit ead7e44
Showing 1 changed file with 20 additions and 18 deletions.
38 changes: 20 additions & 18 deletions src/libs/actions/Report.ts
Original file line number Diff line number Diff line change
Expand Up @@ -571,19 +571,6 @@ function openReport(
];

const successData: OnyxUpdate[] = [
{
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.REPORT}${reportID}`,
value: {
pendingFields: {
createChat: null,
},
errorFields: {
createChat: null,
},
isOptimisticReport: false,
},
},
{
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.REPORT_METADATA}${reportID}`,
Expand Down Expand Up @@ -647,11 +634,26 @@ function openReport(
key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${reportID}`,
value: {[optimisticCreatedAction.reportActionID]: optimisticCreatedAction},
});
successData.push({
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${reportID}`,
value: {[optimisticCreatedAction.reportActionID]: {pendingAction: null}},
});
successData.push(
{
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${reportID}`,
value: {[optimisticCreatedAction.reportActionID]: {pendingAction: null}},
},
{
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.REPORT}${reportID}`,
value: {
pendingFields: {
createChat: null,
},
errorFields: {
createChat: null,
},
isOptimisticReport: false,
},
},
);

// Add optimistic personal details for new participants
const optimisticPersonalDetails: OnyxCollection<PersonalDetails> = {};
Expand Down

0 comments on commit ead7e44

Please sign in to comment.