mirror of
https://github.com/ankitects/anki.git
synced 2025-11-06 12:47:11 -05:00
Fix warnings
This commit is contained in:
parent
f1c50b1ca2
commit
368c1958d2
2 changed files with 6 additions and 4 deletions
|
|
@ -3,10 +3,11 @@ import "../../reviewer/reviewer.scss";
|
||||||
|
|
||||||
addEventListener("message", (e) => {
|
addEventListener("message", (e) => {
|
||||||
switch (e.data.type) {
|
switch (e.data.type) {
|
||||||
case "html":
|
case "html": {
|
||||||
document.body.innerHTML = e.data.value;
|
document.body.innerHTML = e.data.value;
|
||||||
break;
|
break;
|
||||||
case "nightMode":
|
}
|
||||||
|
case "nightMode": {
|
||||||
// This method currently "Flashbangs" the user if they have nightmode on and is a placeholder
|
// This method currently "Flashbangs" the user if they have nightmode on and is a placeholder
|
||||||
// I will probably use #night-mode in the url.
|
// I will probably use #night-mode in the url.
|
||||||
const root = document.querySelector("html")!;
|
const root = document.querySelector("html")!;
|
||||||
|
|
@ -20,9 +21,11 @@ addEventListener("message", (e) => {
|
||||||
root.className = nightMode ? "night-mode" : "";
|
root.className = nightMode ? "night-mode" : "";
|
||||||
root.setAttribute("data-bs-theme", nightMode ? "dark" : "light");
|
root.setAttribute("data-bs-theme", nightMode ? "dark" : "light");
|
||||||
break;
|
break;
|
||||||
default:
|
}
|
||||||
|
default: {
|
||||||
console.warn(`Unknown message type: ${e.data.type}`);
|
console.warn(`Unknown message type: ${e.data.type}`);
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
import { bridgeCommand } from "@tslib/bridgecommand";
|
|
||||||
import { writable } from "svelte/store";
|
import { writable } from "svelte/store";
|
||||||
import type { AnswerButtonInfo } from "./types";
|
import type { AnswerButtonInfo } from "./types";
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue