Skip to content
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

Display EReceipt for distance request in offline mode #32424

Merged
merged 6 commits into from
Dec 4, 2023
Merged
Show file tree
Hide file tree
Changes from 4 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
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import reportPropTypes from '@pages/reportPropTypes';

const propTypes = {
/** source is used to determine the starting index in the array of attachments */
source: PropTypes.string,
source: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),

/** Callback to update the parent modal's state with a source and name from the attachments array */
onNavigate: PropTypes.func,
Expand Down
6 changes: 5 additions & 1 deletion src/pages/home/report/ReportAttachments.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@ const propTypes = {
function ReportAttachments(props) {
const reportID = _.get(props, ['route', 'params', 'reportID']);
const report = ReportUtils.getReport(reportID);
const source = decodeURI(_.get(props, ['route', 'params', 'source']));

// Native file has source is number, but decodeURI return a string.
// So we need to cast the source as a number here to make the compare function in the carousel work well for all cases
const decodedSource = decodeURI(_.get(props, ['route', 'params', 'source']));
const source = Number(decodedSource) || decodedSource;

const onCarouselAttachmentChange = useCallback(
(attachment) => {
Expand Down