Replace browser popups with in-page dialogs; focus new-task prompt
This commit is contained in:
+3
-3
@@ -1,5 +1,5 @@
|
||||
import { del, get, post, put, type NotificationPrefs } from "./api.js";
|
||||
import { errorText, h, replace } from "./dom.js";
|
||||
import { errorText, h, replace, showAlert } from "./dom.js";
|
||||
import { on, state } from "./state.js";
|
||||
|
||||
const kinds: { key: keyof NotificationPrefs; label: string }[] = [
|
||||
@@ -29,7 +29,7 @@ export function mountSettings(root: HTMLElement): () => void {
|
||||
try {
|
||||
state.me = await put("/api/me/notifications", { body: { ...me.notification_prefs, [key]: box.checked } });
|
||||
} catch (err) {
|
||||
alert(errorText(err));
|
||||
void showAlert(errorText(err));
|
||||
}
|
||||
renderPrefs();
|
||||
};
|
||||
@@ -63,7 +63,7 @@ export function mountSettings(root: HTMLElement): () => void {
|
||||
await enable(status.reg);
|
||||
}
|
||||
} catch (err) {
|
||||
alert(errorText(err));
|
||||
void showAlert(errorText(err));
|
||||
}
|
||||
await renderDevice();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user