mirror of
https://github.com/ankitects/anki.git
synced 2025-11-06 12:47:11 -05:00
./check
This commit is contained in:
parent
0db28a7101
commit
c76f013b16
2 changed files with 6 additions and 5 deletions
|
|
@ -720,6 +720,7 @@ post_handlers = {
|
|||
for handler in exposed_backend_list
|
||||
}
|
||||
|
||||
|
||||
def _extract_collection_post_request(path: str) -> DynamicRequest | NotFound:
|
||||
if not aqt.mw.col:
|
||||
return NotFound(message=f"collection not open, ignore request for {path}")
|
||||
|
|
@ -767,7 +768,7 @@ def _check_dynamic_request_permissions():
|
|||
"/_anki/i18nResources",
|
||||
"/_anki/congratsInfo",
|
||||
# TODO: Unsure about this
|
||||
"/_anki/nextCardData"
|
||||
"/_anki/nextCardData",
|
||||
):
|
||||
pass
|
||||
else:
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
// Copyright: Ankitects Pty Ltd and contributors
|
||||
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||
import { CardAnswer, SchedulingStates } from "@generated/anki/scheduler_pb";
|
||||
import type { CardAnswer, SchedulingStates } from "@generated/anki/scheduler_pb";
|
||||
import { nextCardData } from "@generated/backend";
|
||||
import { bridgeCommand } from "@tslib/bridgecommand";
|
||||
import { writable } from "svelte/store";
|
||||
|
|
@ -8,20 +8,20 @@ import { writable } from "svelte/store";
|
|||
export function setupReviewer(iframe: HTMLIFrameElement) {
|
||||
const cardClass = writable("");
|
||||
let answer_html = "";
|
||||
let states: SchedulingStates | undefined;
|
||||
let _states: SchedulingStates | undefined = undefined;
|
||||
|
||||
function updateHtml(htmlString) {
|
||||
iframe.contentWindow?.postMessage({ type: "html", value: htmlString }, "*");
|
||||
}
|
||||
|
||||
async function showQuestion(answer: CardAnswer | null) {
|
||||
let resp = await nextCardData({
|
||||
const resp = await nextCardData({
|
||||
answer: answer || undefined,
|
||||
});
|
||||
// TODO: "Congratulation screen" logic
|
||||
const question = resp.nextCard?.front || "";
|
||||
answer_html = resp.nextCard?.back || "";
|
||||
states = resp.nextCard?.states;
|
||||
_states = resp.nextCard?.states;
|
||||
console.log({ resp });
|
||||
updateHtml(question);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue