Things for ControlNet

This commit is contained in:
space-nuko
2023-05-09 18:40:35 -05:00
parent 2a269f0b86
commit babfb8a4b4
7 changed files with 65 additions and 8 deletions

View File

@@ -7,7 +7,8 @@ export type NotifyOptions = {
title?: string,
type?: "neutral" | "info" | "warning" | "error" | "success",
imageUrl?: string,
timeout?: number | null
timeout?: number | null,
showOn?: "web" | "native" | "all" | "none"
}
function notifyf7(text: string, options: NotifyOptions) {
@@ -76,7 +77,17 @@ function notifyNative(text: string, options: NotifyOptions) {
}
export default function notify(text: string, options: NotifyOptions = {}) {
notifyf7(text, options);
notifyToast(text, options);
notifyNative(text, options)
const showOn = options.showOn || "web";
if (showOn === "none")
return;
if (showOn === "all" || showOn === "web") {
notifyf7(text, options);
notifyToast(text, options);
}
if (showOn === "all" || showOn === "native") {
notifyNative(text, options)
}
}