Skip to content

Commit

Permalink
Clear images before toggling to new project
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanielrindlaub committed Jan 23, 2024
1 parent 9ee262e commit 1cb8b8c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/features/projects/ProjectAndViewNav.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import {
selectRouterLocation,
fetchImageContext,
preFocusImageStart,
clearImages,
} from '../images/imagesSlice.js';
import {
NavigationMenu,
Expand Down Expand Up @@ -207,6 +208,7 @@ const ProjectAndViewNav = () => {
if (projId === selectedProj._id) return;
const project = projects.find((p) => p._id === projId);
const viewId = project.views.find((v) => v.name === 'All images')._id;
dispatch(clearImages());
dispatch(push(`/app/${projId}/${viewId}`));
};

Expand Down

0 comments on commit 1cb8b8c

Please sign in to comment.