Skip to content

Commit 1c32436

Browse files
Merge pull request #448 from monkvision/feature/MN-229/close-early-event
Added a onCloseEarly event
2 parents f91f9e4 + 01e07c4 commit 1c32436

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

packages/camera/src/components/Capture/capture.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ const Capture = forwardRef(({
108108
navigationOptions,
109109
offline,
110110
onChange,
111+
onCloseEarly,
111112
onComplianceChange,
112113
onSettingsChange,
113114
onSightsChange,
@@ -344,6 +345,9 @@ const Capture = forwardRef(({
344345
}, [setAddDamageStatus]);
345346

346347
const handleCloseCaptureEarly = useCallback(() => {
348+
if (typeof onCloseEarly === 'function') {
349+
onCloseEarly();
350+
}
347351
setEndTour(true);
348352
}, [setEndTour]);
349353

@@ -664,6 +668,7 @@ Capture.propTypes = {
664668
onCaptureTourFinish: PropTypes.func,
665669
onCaptureTourStart: PropTypes.func,
666670
onChange: PropTypes.func,
671+
onCloseEarly: PropTypes.func,
667672
onComplianceChange: PropTypes.func,
668673
onComplianceCheckFinish: PropTypes.func,
669674
onComplianceCheckStart: PropTypes.func,
@@ -780,6 +785,7 @@ Capture.defaultProps = {
780785
onCaptureTourFinish: () => {},
781786
onCaptureTourStart: () => {},
782787
onChange: () => {},
788+
onCloseEarly: () => {},
783789
onComplianceChange: () => {},
784790
onSettingsChange: () => {},
785791
onSightsChange: () => {},

0 commit comments

Comments
 (0)