Skip to content

Commit 822d1db

Browse files
authored
Fixed gallery view after all pictures taken (compliant or not) (#933)
1 parent 98617a3 commit 822d1db

File tree

5 files changed

+6
-17
lines changed

5 files changed

+6
-17
lines changed

packages/inspection-capture-web/src/PhotoCapture/PhotoCapture.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,8 +201,6 @@ export function PhotoCapture({
201201
tasksBySight,
202202
complianceOptions,
203203
setIsInitialInspectionFetched,
204-
startTasksOnComplete,
205-
onComplete,
206204
});
207205
const { currentTutorialStep, goToNextTutorialStep, closeTutorial } = usePhotoCaptureTutorial({
208206
enableTutorial,

packages/inspection-capture-web/src/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElementsSight/PhotoCaptureHUDElementsSight.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,10 @@ export function PhotoCaptureHUDElementsSight({
4040
{!tutorialStep && (
4141
<div style={style.elementsContainer}>
4242
<div style={style.top}>
43-
{enableSightTutorial !== PhotoCaptureSightTutorialOption.DISABLED && (
43+
{[
44+
PhotoCaptureSightTutorialOption.CLASSIC,
45+
PhotoCaptureSightTutorialOption.MODERN,
46+
].includes(enableSightTutorial as PhotoCaptureSightTutorialOption) && (
4447
<SightTutorialButton toggleSightTutorial={toggleSightTutorial} />
4548
)}
4649
<SightGuideline

packages/inspection-capture-web/src/PhotoCapture/hooks/usePhotoCaptureSightState.ts

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ import {
2222
TaskName,
2323
ImageStatus,
2424
ProgressStatus,
25-
PhotoCaptureAppConfig,
2625
} from '@monkvision/types';
2726
import { sights } from '@monkvision/sights';
2827
import { useAnalytics } from '@monkvision/analytics';
@@ -81,8 +80,7 @@ export interface PhotoCaptureSightState {
8180
/**
8281
* Parameters of the usePhotoCaptureSightState hook.
8382
*/
84-
export interface PhotoCaptureSightsParams
85-
extends Pick<PhotoCaptureAppConfig, 'startTasksOnComplete'> {
83+
export interface PhotoCaptureSightsParams {
8684
/**
8785
* The inspection ID.
8886
*/
@@ -116,10 +114,6 @@ export interface PhotoCaptureSightsParams
116114
* sight will be used.
117115
*/
118116
tasksBySight?: Record<string, TaskName[]>;
119-
/**
120-
* Callback called when inspection capture is complete.
121-
*/
122-
onComplete?: () => void;
123117
}
124118

125119
function getCaptureTasks(
@@ -215,8 +209,6 @@ export function usePhotoCaptureSightState({
215209
tasksBySight,
216210
setIsInitialInspectionFetched,
217211
complianceOptions,
218-
startTasksOnComplete,
219-
onComplete,
220212
}: PhotoCaptureSightsParams): PhotoCaptureSightState {
221213
if (captureSights.length === 0) {
222214
throw new Error('Empty sight list given to the Monk PhotoCapture component.');
@@ -331,7 +323,7 @@ export function usePhotoCaptureSightState({
331323
});
332324
if (nextSight) {
333325
setSelectedSight(nextSight);
334-
} else if (!startTasksOnComplete || !onComplete) {
326+
} else {
335327
onLastSightTaken();
336328
}
337329
}, [sightsTaken, selectedSight, captureSights, onLastSightTaken]);

packages/inspection-capture-web/test/PhotoCapture/PhotoCapture.test.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,8 +229,6 @@ describe('PhotoCapture component', () => {
229229
loading,
230230
onLastSightTaken: expect.any(Function),
231231
tasksBySight: props.tasksBySight,
232-
startTasksOnComplete: props.startTasksOnComplete,
233-
onComplete: props.onComplete,
234232
complianceOptions: {
235233
enableCompliance: props.enableCompliance,
236234
enableCompliancePerSight: props.enableCompliancePerSight,

packages/inspection-capture-web/test/PhotoCapture/hooks/usePhotoCaptureSightState.test.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,6 @@ function createParams(): PhotoCaptureSightsParams {
4848
useLiveCompliance: true,
4949
},
5050
setIsInitialInspectionFetched: jest.fn(),
51-
onComplete: jest.fn(),
52-
startTasksOnComplete: false,
5351
};
5452
}
5553

0 commit comments

Comments
 (0)