Skip to content

Commit

Permalink
Merge pull request #32424 from dukenv0307/fix/31138
Browse files Browse the repository at this point in the history
Display EReceipt for distance request in offline mode
  • Loading branch information
Joel Bettner authored Dec 4, 2023
2 parents b46a967 + 6267893 commit c21ef10
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/components/AttachmentModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ import withWindowDimensions, {windowDimensionsPropTypes} from './withWindowDimen

const propTypes = {
/** Optional source (URL, SVG function) for the image shown. If not passed in via props must be specified when modal is opened. */
source: PropTypes.oneOfType([PropTypes.string, PropTypes.func]),
source: PropTypes.oneOfType([PropTypes.string, PropTypes.func, PropTypes.number]),

/** Optional callback to fire when we want to preview an image and approve it for use. */
onConfirm: PropTypes.func,
Expand Down
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
5 changes: 4 additions & 1 deletion src/pages/home/report/ReportAttachments.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ 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']));

// In native the imported images sources are of type number. Ref: https://reactnative.dev/docs/image#imagesource
const decodedSource = decodeURI(_.get(props, ['route', 'params', 'source']));
const source = Number(decodedSource) || decodedSource;

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

0 comments on commit c21ef10

Please sign in to comment.