From 93a76115542cd479870842985b56694f7fe90a95 Mon Sep 17 00:00:00 2001 From: polina4096 Date: Mon, 20 Jan 2025 00:33:32 +0300 Subject: [PATCH] Properly dispose monako tab models --- packages/repl/src/components/editor/Editor.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/repl/src/components/editor/Editor.tsx b/packages/repl/src/components/editor/Editor.tsx index 51c79f1..19b065d 100644 --- a/packages/repl/src/components/editor/Editor.tsx +++ b/packages/repl/src/components/editor/Editor.tsx @@ -15,7 +15,7 @@ const DEFAULT_CODE = ` /** * This playground comes pre-loaded with all @mtcute/* libraries, * as well as a pre-configured Telegram client (available as \`tg\` global variable). - * + * * Exports from this file will become available in the REPL. */ export const self = await tg.getMe() @@ -134,6 +134,7 @@ export default function Editor(props: EditorProps) { // a tab was deleted const changed = findChangedTab(tabs, prevTabs) if (!changed) return + modelsByTab.get(changed.id)?.dispose() modelsByTab.delete(changed.id) } }))