Skip to content

Commit

Permalink
#255 enable to make interaction after switching of snapshots in project
Browse files Browse the repository at this point in the history
  • Loading branch information
tibor-postek-m2ms committed Apr 16, 2020
1 parent e5ee3d7 commit b72493b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
3 changes: 2 additions & 1 deletion js/components/helpers/useEnableUserInteracion.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ export const useDisableUserInteraction = () => {
countOfPendingNglObjects[VIEWS.SUMMARY_VIEW] === 0 &&
countOfPendingNglObjects[VIEWS.MAJOR_VIEW] === 0 &&
((countOfRemainingMoleculeGroups === 0 && proteinsHasLoaded === true) ||
(countOfRemainingMoleculeGroups === null && proteinsHasLoaded === null))
(countOfRemainingMoleculeGroups === null && proteinsHasLoaded === null) ||
(countOfRemainingMoleculeGroups === null && proteinsHasLoaded === true))
) {
if (disableInteraction === true) {
setDisableInteraction(false);
Expand Down
6 changes: 5 additions & 1 deletion js/components/preview/redux/dispatchActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,11 @@ export const shouldLoadProtein = ({
}

// decide to load existing snapshot
else if (currentSnapshotID !== null && currentSnapshotData !== null) {
else if (
currentSnapshotID !== null &&
(!routeSnapshotID || routeSnapshotID === currentSnapshotID.toString()) &&
currentSnapshotData !== null
) {
dispatch(reloadSession(currentSnapshotData, nglViewList));
}

Expand Down
4 changes: 2 additions & 2 deletions js/components/snapshot/redux/dispatchActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ export const reloadSession = (snapshotData, nglViewList) => (dispatch, getState)
if (nglViewList.length > 0) {
dispatch(reloadSelectionReducer(snapshotData.selectionReducers));

nglViewList.forEach(async nglView => {
await dispatch(reloadNglViewFromSnapshot(nglView.stage, nglView.id, snapshotData.nglReducers));
nglViewList.forEach(nglView => {
dispatch(reloadNglViewFromSnapshot(nglView.stage, nglView.id, snapshotData.nglReducers));
});

if (snapshotData.selectionReducers.vectorOnList.length !== 0) {
Expand Down

0 comments on commit b72493b

Please sign in to comment.