mirror of
https://github.com/open-webui/open-webui
synced 2025-06-26 18:26:48 +00:00
refac
This commit is contained in:
parent
4fe45d4430
commit
51fe33395b
@ -11,7 +11,7 @@
|
||||
|
||||
import { oneDark } from '@codemirror/theme-one-dark';
|
||||
|
||||
import { onMount, createEventDispatcher, getContext, tick } from 'svelte';
|
||||
import { onMount, createEventDispatcher, getContext, tick, onDestroy } from 'svelte';
|
||||
|
||||
import PyodideWorker from '$lib/workers/pyodide.worker?worker';
|
||||
|
||||
@ -312,6 +312,12 @@ print(black.format_str("""${code.replace(/\\/g, '\\\\').replace(/`/g, '\\`').rep
|
||||
document.removeEventListener('keydown', keydownHandler);
|
||||
};
|
||||
});
|
||||
|
||||
onDestroy(() => {
|
||||
if (pyodideWorkerInstance) {
|
||||
pyodideWorkerInstance.terminate();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<div id="code-textarea-{id}" class="h-full w-full text-sm" />
|
||||
|
Loading…
Reference in New Issue
Block a user