From 3ba6f8fba9dbd6e479f4297a5a05b51273e461a3 Mon Sep 17 00:00:00 2001 From: Kristóf Marussy Date: Tue, 26 Sep 2023 03:29:51 +0200 Subject: feat(frontend): save in URL fragment --- subprojects/frontend/src/editor/EditorStore.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'subprojects/frontend/src/editor') diff --git a/subprojects/frontend/src/editor/EditorStore.ts b/subprojects/frontend/src/editor/EditorStore.ts index 9508858d..87c4040e 100644 --- a/subprojects/frontend/src/editor/EditorStore.ts +++ b/subprojects/frontend/src/editor/EditorStore.ts @@ -74,7 +74,11 @@ export default class EditorStore { selectedGeneratedModel: string | undefined; - constructor(initialValue: string, pwaStore: PWAStore) { + constructor( + initialValue: string, + pwaStore: PWAStore, + onUpdate: (text: string) => void, + ) { this.id = nanoid(); this.state = createEditorState(initialValue, this); this.delayedErrors = new EditorErrors(this); @@ -86,7 +90,7 @@ export default class EditorStore { if (this.disposed) { return; } - this.client = new LazyXtextClient(this, pwaStore); + this.client = new LazyXtextClient(this, pwaStore, onUpdate); this.client.start(); }); })().catch((error) => { -- cgit v1.2.3-54-g00ecf