From 62fdb9cda89709e1d9a6ef8d17ef07723f46376a Mon Sep 17 00:00:00 2001 From: Adam Obuchowicz Date: Wed, 7 Feb 2024 14:34:56 +0100 Subject: [PATCH] Dispose ydocs provider when closing app --- app/gui2/src/App.vue | 6 +++++- app/gui2/src/stores/project/index.ts | 13 +++++++++---- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/app/gui2/src/App.vue b/app/gui2/src/App.vue index 1c59d9519bed..faf15b8365c7 100644 --- a/app/gui2/src/App.vue +++ b/app/gui2/src/App.vue @@ -6,7 +6,8 @@ import { useSuggestionDbStore } from '@/stores/suggestionDatabase' import { configValue, type ApplicationConfig, type ApplicationConfigValue } from '@/util/config' import ProjectView from '@/views/ProjectView.vue' import { isDevMode } from 'shared/util/detect' -import { computed, onMounted, toRaw } from 'vue' +import { computed, onMounted, onUnmounted, toRaw } from 'vue' +import { useProjectStore } from './stores/project' const props = defineProps<{ config: ApplicationConfig @@ -26,6 +27,9 @@ onMounted(() => { ;(window as any).suggestionDb = toRaw(suggestionDb.entries) } }) +onUnmounted(() => { + useProjectStore().disposeYDocsProvider() +})