Skip to content

Commit

Permalink
Merge pull request #43507 from dominictb/fix/43260
Browse files Browse the repository at this point in the history
fix: check the existence of reportDraft in withWritableReportOrNotFound
  • Loading branch information
yuwenmemon authored Jun 17, 2024
2 parents d7c2781 + cd0dce5 commit f04aca9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/pages/iou/request/step/withWritableReportOrNotFound.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,15 @@ export default function <TProps extends WithWritableReportOrNotFoundProps<MoneyR
): React.ComponentType<Omit<TProps & RefAttributes<TRef>, keyof WithWritableReportOrNotFoundOnyxProps>> {
// eslint-disable-next-line rulesdir/no-negated-variables
function WithWritableReportOrNotFound(props: TProps, ref: ForwardedRef<TRef>) {
const {report = {reportID: ''}, route, isLoadingApp = true} = props;
const {report = {reportID: ''}, route, isLoadingApp = true, reportDraft} = props;
const iouTypeParamIsInvalid = !Object.values(CONST.IOU.TYPE)
.filter((type) => shouldIncludeDeprecatedIOUType || (type !== CONST.IOU.TYPE.REQUEST && type !== CONST.IOU.TYPE.SEND))
.includes(route.params?.iouType);
const isEditing = 'action' in route.params && route.params?.action === CONST.IOU.ACTION.EDIT;
const canUserPerformWriteAction = ReportUtils.canUserPerformWriteAction(report);

useEffect(() => {
if (!!report?.reportID || !route.params.reportID) {
if (!!report?.reportID || !route.params.reportID || !!reportDraft) {
return;
}

Expand Down

0 comments on commit f04aca9

Please sign in to comment.