@@ -8,8 +8,9 @@ import { restoreCurrentActionsList } from '../../../reducers/tracking/dispatchAc
8
8
import { setIsSnapshotDirty } from '../../../reducers/tracking/actions' ;
9
9
import { setDownloadStructuresDialogOpen } from '../../snapshot/redux/actions' ;
10
10
import { ToastContext } from '../../toast' ;
11
+ import { LegacySnapshotModal } from '../legacySnapshotModal' ;
11
12
12
- export const ProjectPreview = memo ( ( { } ) => {
13
+ export const ProjectPreview = memo ( ( { } ) => {
13
14
const { toast } = useContext ( ToastContext ) ;
14
15
const [ canShow , setCanShow ] = useState ( undefined ) ;
15
16
const isSnapshotLoaded = useRef ( undefined ) ;
@@ -23,6 +24,8 @@ export const ProjectPreview = memo(({ }) => {
23
24
const isActionRestoring = useSelector ( state => state . trackingReducers . isActionRestoring ) ;
24
25
const isActionRestored = useSelector ( state => state . trackingReducers . isActionRestored ) ;
25
26
27
+ const [ showLegacySnapshotModal , setShowLegacySnapshotModal ] = useState ( false ) ;
28
+
26
29
useEffect ( ( ) => {
27
30
if ( ! snapshotId && currentSnapshotID === null ) {
28
31
dispatch ( loadSnapshotByProjectID ( projectId ) )
@@ -49,6 +52,7 @@ export const ProjectPreview = memo(({ }) => {
49
52
setCanShow ( true ) ;
50
53
} else {
51
54
setCanShow ( false ) ;
55
+ setShowLegacySnapshotModal ( true ) ;
52
56
}
53
57
if ( response . data ) {
54
58
const dataObj = JSON . parse ( response . data ) ;
@@ -59,6 +63,7 @@ export const ProjectPreview = memo(({ }) => {
59
63
} else {
60
64
isSnapshotLoaded . current = response ;
61
65
setCanShow ( false ) ;
66
+ setShowLegacySnapshotModal ( true ) ;
62
67
}
63
68
}
64
69
} )
@@ -96,5 +101,7 @@ export const ProjectPreview = memo(({ }) => {
96
101
( currentSessionProject . projectID === null || currentSessionProject . authorID === null ) )
97
102
}
98
103
/>
99
- ) : null ;
104
+ ) : (
105
+ < LegacySnapshotModal open = { showLegacySnapshotModal } project = { projectId } snapshot = { snapshotId } />
106
+ ) ;
100
107
} ) ;
0 commit comments