@@ -650,6 +650,7 @@ export const getCleanStateForSnapshot = () => (dispatch, getState) => {
650
650
snapshotData . selectionReducers . toBeDisplayedList . length + numberOfItemsRHS ;
651
651
snapshotData . nglReducers . isSnapshotRendering = true ;
652
652
snapshotData . nglReducers . nglViewFromSnapshotRendered = false ;
653
+ snapshotData . nglReducers . isNGLQueueEmpty = false ;
653
654
654
655
return snapshotData ;
655
656
} ;
@@ -665,6 +666,15 @@ export const changeSnapshot = (projectID, snapshotID, stage, fromJobExec = false
665
666
666
667
const snapshotState = snapshotResponse . data . additional_info . snapshotState ;
667
668
669
+ if ( ! fromJobExec ) {
670
+ //orientation animation
671
+ const newOrientation = snapshotState . nglReducers . nglOrientations [ VIEWS . MAJOR_VIEW ] ;
672
+ //log with timestamp
673
+ console . log ( `Switch - Before smooth animation: ${ new Date ( ) . toLocaleTimeString ( ) } ` ) ;
674
+ await stage . animationControls . orient ( newOrientation . elements , 2000 ) ; //.then(() => {
675
+ console . log ( `Switch - After smooth animation: ${ new Date ( ) . toLocaleTimeString ( ) } ` ) ;
676
+ }
677
+
668
678
dispatch (
669
679
setCurrentSnapshot ( {
670
680
id : snapshotResponse . data . id ,
@@ -683,9 +693,10 @@ export const changeSnapshot = (projectID, snapshotID, stage, fromJobExec = false
683
693
let toBeDisplayedLHSNewDeepCopy = null ;
684
694
let toBeDisplayedRHSNewDeepCopy = null ;
685
695
if ( ! fromJobExec ) {
686
- //orientation animation
687
- const newOrientation = snapshotState . nglReducers . nglOrientations [ VIEWS . MAJOR_VIEW ] ;
688
- await stage . animationControls . orient ( newOrientation . elements , 2000 ) ; //.then(() => {
696
+ currentState . snapshotReducers . switchingSnapshotWithinProject = true ;
697
+ snapshotState . snapshotReducers . switchingSnapshotWithinProject = true ;
698
+ snapshotState . nglReducers . isNGLQueueEmpty = false ;
699
+
689
700
const toBeDisplayedLHSCurrent = currentState . selectionReducers . toBeDisplayedList ;
690
701
const toBeDisplayedRHSCurrent = currentState . datasetsReducers . toBeDisplayedList ;
691
702
const toBeDisplayedLHSNew = snapshotState . selectionReducers . toBeDisplayedList ;
@@ -727,6 +738,7 @@ export const changeSnapshot = (projectID, snapshotID, stage, fromJobExec = false
727
738
728
739
currentState = getState ( ) ;
729
740
// const copyOfCurrentState = deepClone(currentState);
741
+ console . log ( `RenderingProgressDialog - merging state` ) ;
730
742
const newState = deepMergeWithPriorityAndBlackList (
731
743
// copyOfCurrentState,
732
744
currentState ,
@@ -782,43 +794,11 @@ export const isSnapshotModified = snapshotID => async (dispatch, getState) => {
782
794
delete originalSnapshotStateCopy . selectionReducers . toastMessages ; //array
783
795
delete currentSnapshotStateCopy . selectionReducers . toastMessages ;
784
796
785
- originalSnapshotStateCopy . selectionReducers . toBeDisplayedList = originalSnapshotStateCopy . selectionReducers . toBeDisplayedList . map (
786
- obj => ( {
787
- ...obj ,
788
- center : false ,
789
- rendered : true
790
- } )
791
- ) ;
792
- let toBeDisplayedRHS = { } ;
793
- let numberOfItemsRHS = 0 ;
794
- Object . keys ( originalSnapshotStateCopy . datasetsReducers . toBeDisplayedList ) . forEach ( datasetID => {
795
- toBeDisplayedRHS [ datasetID ] = originalSnapshotStateCopy . datasetsReducers . toBeDisplayedList [ datasetID ] . map ( obj => ( {
796
- ...obj ,
797
- center : false ,
798
- rendered : true
799
- } ) ) ;
800
- numberOfItemsRHS += toBeDisplayedRHS [ datasetID ] . length ;
801
- } ) ;
802
- originalSnapshotStateCopy . datasetsReducers . toBeDisplayedList = toBeDisplayedRHS ;
797
+ delete originalSnapshotStateCopy . selectionReducers . toBeDisplayedList ;
798
+ delete originalSnapshotStateCopy . datasetsReducers . toBeDisplayedList ;
803
799
804
- currentSnapshotStateCopy . selectionReducers . toBeDisplayedList = currentSnapshotStateCopy . selectionReducers . toBeDisplayedList . map (
805
- obj => ( {
806
- ...obj ,
807
- center : false ,
808
- rendered : true
809
- } )
810
- ) ;
811
- toBeDisplayedRHS = { } ;
812
- numberOfItemsRHS = 0 ;
813
- Object . keys ( currentSnapshotStateCopy . datasetsReducers . toBeDisplayedList ) . forEach ( datasetID => {
814
- toBeDisplayedRHS [ datasetID ] = currentSnapshotStateCopy . datasetsReducers . toBeDisplayedList [ datasetID ] . map ( obj => ( {
815
- ...obj ,
816
- center : false ,
817
- rendered : true
818
- } ) ) ;
819
- numberOfItemsRHS += toBeDisplayedRHS [ datasetID ] . length ;
820
- } ) ;
821
- currentSnapshotStateCopy . datasetsReducers . toBeDisplayedList = toBeDisplayedRHS ;
800
+ delete currentSnapshotStateCopy . selectionReducers . toBeDisplayedList ;
801
+ delete currentSnapshotStateCopy . datasetsReducers . toBeDisplayedList ;
822
802
823
803
let path = '' ;
824
804
const isModified = ! deepEqual ( originalSnapshotStateCopy , currentSnapshotStateCopy , path ) ;
0 commit comments