Skip to content

Commit

Permalink
Merge pull request #45758 from tienifr/fix/45247
Browse files Browse the repository at this point in the history
fix: strike through IOU and REPORTPREVIEW once delete
  • Loading branch information
puneetlath authored Jul 25, 2024
2 parents 5df5630 + 085026f commit 266d4cb
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,9 @@ function MoneyRequestPreviewContent({
}}
errorRowStyles={[styles.mbn1]}
needsOffscreenAlphaCompositing
pendingAction={action.pendingAction}
shouldDisableStrikeThrough={!isDeleted}
shouldDisableOpacity={!isDeleted}
>
<View
style={[
Expand Down
9 changes: 9 additions & 0 deletions src/libs/actions/IOU.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5714,6 +5714,15 @@ function deleteMoneyRequest(transactionID: string, reportAction: OnyxTypes.Repor
lastVisibleActionCreated: ReportActionsUtils.getLastVisibleAction(iouReport?.chatReportID ?? '-1', {[reportPreviewAction?.reportActionID ?? '-1']: null})?.created,
},
});
optimisticData.push({
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.REPORT}${iouReport?.reportID}`,
value: {
pendingFields: {
preview: CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE,
},
},
});
}

const successData: OnyxUpdate[] = [
Expand Down

0 comments on commit 266d4cb

Please sign in to comment.