From 31529a3b2b36096d2744a6cc74819f3caa40998b Mon Sep 17 00:00:00 2001 From: Miodec Date: Sat, 15 Feb 2025 19:14:40 +0100 Subject: [PATCH] impr: make uncaught error notifications important on dev !nuf --- frontend/src/ts/event-handlers/global.ts | 2 ++ frontend/src/ts/ui.ts | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/frontend/src/ts/event-handlers/global.ts b/frontend/src/ts/event-handlers/global.ts index 0e9156439..0bb544eb3 100644 --- a/frontend/src/ts/event-handlers/global.ts +++ b/frontend/src/ts/event-handlers/global.ts @@ -37,6 +37,7 @@ window.onerror = function (message, url, line, column, error): void { Notifications.add(error?.message ?? "Undefined message", -1, { customTitle: "DEV: Unhandled error", duration: 5, + important: true, }); } void log("error", { @@ -51,6 +52,7 @@ window.onunhandledrejection = function (e): void { Notifications.add(`${message}`, -1, { customTitle: "DEV: Unhandled rejection", duration: 5, + important: true, }); console.error(e); } diff --git a/frontend/src/ts/ui.ts b/frontend/src/ts/ui.ts index abe7bd53c..99db858d2 100644 --- a/frontend/src/ts/ui.ts +++ b/frontend/src/ts/ui.ts @@ -58,7 +58,10 @@ function updateKeytips(): void { if (isDevEnvironment()) { window.onerror = function (error): void { if (JSON.stringify(error).includes("x_magnitude")) return; - Notifications.add(JSON.stringify(error), -1); + Notifications.add(JSON.stringify(error), -1, { + important: true, + duration: 5, + }); }; $("header #logo .top").text("localhost"); $("head title").text($("head title").text() + " (localhost)");