Properly dispose monako tab models
All checks were successful
Docs / build (push) Successful in 2m19s
All checks were successful
Docs / build (push) Successful in 2m19s
This commit is contained in:
parent
dee037955f
commit
93a7611554
1 changed files with 2 additions and 1 deletions
|
@ -15,7 +15,7 @@ const DEFAULT_CODE = `
|
||||||
/**
|
/**
|
||||||
* This playground comes pre-loaded with all @mtcute/* libraries,
|
* This playground comes pre-loaded with all @mtcute/* libraries,
|
||||||
* as well as a pre-configured Telegram client (available as \`tg\` global variable).
|
* as well as a pre-configured Telegram client (available as \`tg\` global variable).
|
||||||
*
|
*
|
||||||
* Exports from this file will become available in the REPL.
|
* Exports from this file will become available in the REPL.
|
||||||
*/
|
*/
|
||||||
export const self = await tg.getMe()
|
export const self = await tg.getMe()
|
||||||
|
@ -134,6 +134,7 @@ export default function Editor(props: EditorProps) {
|
||||||
// a tab was deleted
|
// a tab was deleted
|
||||||
const changed = findChangedTab(tabs, prevTabs)
|
const changed = findChangedTab(tabs, prevTabs)
|
||||||
if (!changed) return
|
if (!changed) return
|
||||||
|
modelsByTab.get(changed.id)?.dispose()
|
||||||
modelsByTab.delete(changed.id)
|
modelsByTab.delete(changed.id)
|
||||||
}
|
}
|
||||||
}))
|
}))
|
||||||
|
|
Loading…
Reference in a new issue