diff --git a/src/oj/problem/components/ProblemEditor.vue b/src/oj/problem/components/ProblemEditor.vue index 84ea7f8..ed6d7f1 100644 --- a/src/oj/problem/components/ProblemEditor.vue +++ b/src/oj/problem/components/ProblemEditor.vue @@ -7,7 +7,7 @@ import { SOURCES } from "utils/constants" import SyncCodeEditor from "shared/components/SyncCodeEditor.vue" import { useBreakpoints } from "shared/composables/breakpoints" import storage from "utils/storage" -import { LANGUAGE } from "utils/types" +import type { LANGUAGE } from "utils/types" import Form from "./Form.vue" const FlowchartEditor = defineAsyncComponent( @@ -51,6 +51,13 @@ onMounted(loadCode) watch(() => problem.value?._id, loadCode) +watch( + () => codeStore.code.value, + (v) => { + storage.set(storageKey.value, v) + }, +) + const changeCode = (v: string) => { storage.set(storageKey.value, v) }