Show custom touch layout's author name in toast message

This commit is contained in:
redphx
2024-05-08 17:04:14 +07:00
parent d8fada8f5d
commit 26bf14eda6
8 changed files with 65 additions and 18 deletions

View File

@@ -2,6 +2,7 @@ import { CE } from "@utils/html";
type ToastOptions = {
instant?: boolean;
html?: boolean;
}
export class Toast {
@@ -40,9 +41,13 @@ export class Toast {
Toast.#timeout = window.setTimeout(Toast.#hide, Toast.#DURATION);
// Get values from item
const [msg, status, _] = Toast.#stack.shift()!;
const [msg, status, options] = Toast.#stack.shift()!;
Toast.#$msg.textContent = msg;
if (options.html) {
Toast.#$msg.innerHTML = msg;
} else {
Toast.#$msg.textContent = msg;
}
if (status) {
Toast.#$status.classList.remove('bx-gone');