Skip to content

Commit

Permalink
Merge pull request #33562 from DylanDylann/fix/30884
Browse files Browse the repository at this point in the history
Fix/30884: Redirect to upload screen if file is lost
  • Loading branch information
cristipaval authored Jan 9, 2024
2 parents 108b5e0 + 68035f5 commit 0f2e55b
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/libs/IOUUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import type {ValueOf} from 'type-fest';
import CONST from '@src/CONST';
import ROUTES from '@src/ROUTES';
import type {Report, Transaction} from '@src/types/onyx';
import * as IOU from './actions/IOU';
import * as CurrencyUtils from './CurrencyUtils';
import * as FileUtils from './fileDownload/FileUtils';
import Navigation from './Navigation/Navigation';
Expand Down Expand Up @@ -38,7 +39,14 @@ function navigateToStartStepIfScanFileCannotBeRead(
return;
}

const onFailure = () => navigateToStartMoneyRequestStep(requestType, iouType, transactionID, reportID);
const onFailure = () => {
IOU.setMoneyRequestReceipt_temporaryForRefactor(transactionID, '', '');
if (requestType === CONST.IOU.REQUEST_TYPE.MANUAL) {
Navigation.navigate(ROUTES.MONEY_REQUEST_STEP_SCAN.getRoute(iouType, transactionID, reportID, Navigation.getActiveRouteWithoutParams()));
return;
}
navigateToStartMoneyRequestStep(requestType, iouType, transactionID, reportID);
};
FileUtils.readFileAsync(receiptPath, receiptFilename, onSuccess, onFailure);
}

Expand Down

0 comments on commit 0f2e55b

Please sign in to comment.