Skip to content

Commit

Permalink
Remove selections when unloading project
Browse files Browse the repository at this point in the history
Also make sure the project menu is set to false so it can't get into a bad state if the modal is closed by loadProject.
  • Loading branch information
Arzte committed Jul 17, 2024
1 parent 9449aed commit f0499ef
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions components/viewer/modal/ViewProjectMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
<script setup lang="ts">
import { ViewerProjectList } from 'composables/viewer';
import { useProjectRefs, useProjectStore } from '~/composables/store/project';
import { useViewerStore } from '~/composables/store/viewer';
const isLoading = ref<boolean>(false);
Expand All @@ -44,6 +45,7 @@ const { projectList } = defineProps<{
}>();
const { loadProject, unloadProject } = useProjectStore();
const { toggleProjectMenu } = useViewerStore();
const { isLoaded } = useProjectRefs();
const loadRemoteFile = async ({ target }: MouseEvent) => {
Expand All @@ -60,6 +62,7 @@ const loadRemoteFile = async ({ target }: MouseEvent) => {
nextTick(() => {
if (!isLoaded.value) {
loadProject(result, fileURL);
toggleProjectMenu(false);
}
});
}
Expand Down
1 change: 1 addition & 0 deletions composables/store/project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ export const useProjectStore = defineStore('project', () => {
};
const unloadProject = () => {
project.value = null;
selected.value = {};
};

const setSelected = (id: string, isSelected: boolean) => {
Expand Down

0 comments on commit f0499ef

Please sign in to comment.