Skip to content

Handle undefined IOU Report on IOUdetails page #4534

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Aug 12, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/languages/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,7 @@ export default {
notFound: {
chatYouLookingForCannotBeFound: 'The chat you are looking for cannot be found.',
getMeOutOfHere: 'Get me out of here',
iouReportNotFound: 'Payment details you are looking for cannot be found.',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also the change i suggested here earlier doesn't seem to be applied, Basically, i suggest that it begins with,

The

so the complete text looks like,

The payment details you are looking for cannot be found.

},
setPasswordPage: {
enterPassword: 'Enter a password',
Expand Down
3 changes: 2 additions & 1 deletion src/languages/es.js
Original file line number Diff line number Diff line change
Expand Up @@ -336,8 +336,9 @@ export default {
createGroup: 'Crear Grupo',
},
notFound: {
chatYouLookingForCannotBeFound: 'No se pudo encontrar el chat que estabas buscando.',
chatYouLookingForCannotBeFound: 'No se pudo encontrar el chat que está buscando.',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you change this to,

El chat que estás buscando no se ha podido encontrar.

getMeOutOfHere: 'Sácame de aquí',
iouReportNotFound: 'No se pudo encontrar los detalles de pago que está buscando.',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you change this to,

Los detalles del pago que estás buscando no se han podido encontrar.

},
setPasswordPage: {
enterPassword: 'Escribe una contraseña',
Expand Down
8 changes: 7 additions & 1 deletion src/libs/actions/Report.js
Original file line number Diff line number Diff line change
Expand Up @@ -461,11 +461,17 @@ function removeOptimisticActions(reportID) {
*
* @param {Number} iouReportID - ID of the report we are fetching
* @param {Number} chatReportID - associated chatReportID, set as an iouReport field
* @param {Boolean} [shouldRedirectIfEmpty=false] - Whether to redirect to Active Report Screen if IOUReport is empty
* @returns {Promise}
*/
function fetchIOUReportByID(iouReportID, chatReportID) {
function fetchIOUReportByID(iouReportID, chatReportID, shouldRedirectIfEmpty = false) {
return fetchIOUReport(iouReportID, chatReportID)
.then((iouReportObject) => {
if (!iouReportObject && shouldRedirectIfEmpty) {
Growl.error(translateLocal('notFound.iouReportNotFound'));
Navigation.navigate(ROUTES.REPORT);
return;
}
setLocalIOUReportData(iouReportObject);
return iouReportObject;
});
Expand Down
2 changes: 1 addition & 1 deletion src/pages/iou/IOUDetailsModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ class IOUDetailsModal extends Component {

componentDidMount() {
this.isComponentMounted = true;
fetchIOUReportByID(this.props.route.params.iouReportID, this.props.route.params.chatReportID);
fetchIOUReportByID(this.props.route.params.iouReportID, this.props.route.params.chatReportID, true);
this.addVenmoPaymentOptionIfAvailable();
this.addExpensifyPaymentOptionIfAvailable();
}
Expand Down