mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 14:32:22 -04:00
Fix Toast component mounting
This commit is contained in:
parent
543f97eb10
commit
aa493f8293
1 changed files with 4 additions and 2 deletions
|
@ -7,6 +7,7 @@ import * as tr from "@generated/ftl";
|
||||||
import { fabric } from "fabric";
|
import { fabric } from "fabric";
|
||||||
import { get } from "svelte/store";
|
import { get } from "svelte/store";
|
||||||
|
|
||||||
|
import { mount } from "svelte";
|
||||||
import { optimumCssSizeForCanvas } from "./canvas-scale";
|
import { optimumCssSizeForCanvas } from "./canvas-scale";
|
||||||
import { hideAllGuessOne, notesDataStore, saveNeededStore, tagsWritable, textEditingState } from "./store";
|
import { hideAllGuessOne, notesDataStore, saveNeededStore, tagsWritable, textEditingState } from "./store";
|
||||||
import Toast from "./Toast.svelte";
|
import Toast from "./Toast.svelte";
|
||||||
|
@ -50,13 +51,14 @@ export const setupMaskEditorForEdit = async (
|
||||||
const clozeNoteResponse = await getImageOcclusionNote({ noteId: BigInt(noteId) });
|
const clozeNoteResponse = await getImageOcclusionNote({ noteId: BigInt(noteId) });
|
||||||
const kind = clozeNoteResponse.value?.case;
|
const kind = clozeNoteResponse.value?.case;
|
||||||
if (!kind || kind === "error") {
|
if (!kind || kind === "error") {
|
||||||
new Toast({
|
mount(Toast, {
|
||||||
target: document.body,
|
target: document.body,
|
||||||
props: {
|
props: {
|
||||||
message: tr.notetypesErrorGettingImagecloze(),
|
message: tr.notetypesErrorGettingImagecloze(),
|
||||||
type: "error",
|
type: "error",
|
||||||
|
showToast: true,
|
||||||
},
|
},
|
||||||
}).$set({ showToast: true });
|
});
|
||||||
throw "error getting cloze";
|
throw "error getting cloze";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue