Anki/ts/routes/editor/+page.svelte
Abdo 3073ef02b5 Remove editorReady()
bridgeCommand() looks cleaner here
2025-05-25 21:14:10 +03:00

23 lines
697 B
Svelte

<!--
Copyright: Ankitects Pty Ltd and contributors
License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
-->
<script lang="ts">
import { onMount } from "svelte";
import { setupEditor } from "./base";
import * as base from "./base";
import { page } from "$app/state";
import type { EditorMode } from "./types";
import { globalExport } from "@tslib/globals";
import { bridgeCommand } from "@tslib/bridgecommand";
const mode = (page.url.searchParams.get("mode") ?? "add") as EditorMode;
globalExport(base);
onMount(() => {
setupEditor(mode).then(() => {
bridgeCommand("editorReady");
});
});
</script>