Skip to content

Commit

Permalink
(fix) O3-2662: Unable to attach images when registering/editing a pat…
Browse files Browse the repository at this point in the history
…ient (#1585)
  • Loading branch information
jwnasambu authored Jan 30, 2024
1 parent 49ece73 commit 7deb35a
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { Button } from '@carbon/react';
import { Camera } from '@carbon/react/icons';
import { showModal, toOmrsIsoString } from '@openmrs/esm-framework';
import styles from './capture-photo.scss';
import { type UploadedFile } from '../attachments-types';

export interface CapturePhotoProps {
onCapturePhoto(dataUri: string, photoDateTime: string): void;
Expand All @@ -16,10 +17,12 @@ const CapturePhoto: React.FC<CapturePhotoProps> = ({ initialState, onCapturePhot

const showCam = useCallback(() => {
const close = showModal('capture-photo-modal', {
saveFile(dataUri: string) {
setDataUri(dataUri);
onCapturePhoto(dataUri, toOmrsIsoString(new Date()));
close();
saveFile(file: UploadedFile) {
return Promise.resolve().then(() => {
setDataUri(file.base64Content);
onCapturePhoto(file.base64Content, toOmrsIsoString(new Date()));
close();
});
},
collectDescription: false,
closeModal: () => {
Expand Down

0 comments on commit 7deb35a

Please sign in to comment.