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 all 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
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