perf: memoize derived render data
This commit is contained in:
@@ -3,6 +3,8 @@
|
||||
* Falls back gracefully when Notification API is unavailable.
|
||||
*/
|
||||
|
||||
import { toast } from "../components/toast/toastStore";
|
||||
|
||||
let permissionGranted = false;
|
||||
|
||||
async function requestPermission(): Promise<boolean> {
|
||||
@@ -35,9 +37,7 @@ export function notifyTaskCompleted(label: string, mode: "image" | "video" = "im
|
||||
|
||||
// Use the existing toast system for in-app notifications
|
||||
function dispatchGenToast(msg: string) {
|
||||
try {
|
||||
import("../components/toast/toastStore").then((m) => m.toast(msg, "success"));
|
||||
} catch { /* toast system not loaded */ }
|
||||
toast(msg, "success");
|
||||
}
|
||||
|
||||
/** Call once on app init to pre-warm permission. */
|
||||
|
||||
Reference in New Issue
Block a user