aboutsummaryrefslogtreecommitdiffstats
path: root/packages/meshbay-hub/src/meshbay_hub/static/node-page.js
diff options
context:
space:
mode:
authorChristophe Besson <cbesson@gmail.com>2026-09-21 19:53:33 +0200
committerChristophe Besson <cbesson@gmail.com>2026-09-21 19:53:33 +0200
commit9f3445d03f106ee3ebd8b4b1bd546a08d9169af7 (patch)
treefabae2b4c9e2fee75a73c5ba1479075be908a584 /packages/meshbay-hub/src/meshbay_hub/static/node-page.js
parent24b563d0073849d0ba74c3fce9822a70c98e9d9f (diff)
downloadmeshbay-9f3445d03f106ee3ebd8b4b1bd546a08d9169af7.tar.gz
fix: ask in the page instead of native confirm/alert
A native confirm() or alert() leaves the desktop client unable to type until the window is refocused. ask.js draws both in the page; the SPA test now bans all three browser dialogs. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Diffstat (limited to 'packages/meshbay-hub/src/meshbay_hub/static/node-page.js')
-rw-r--r--packages/meshbay-hub/src/meshbay_hub/static/node-page.js15
1 files changed, 8 insertions, 7 deletions
diff --git a/packages/meshbay-hub/src/meshbay_hub/static/node-page.js b/packages/meshbay-hub/src/meshbay_hub/static/node-page.js
index 0b05dad..a59c100 100644
--- a/packages/meshbay-hub/src/meshbay_hub/static/node-page.js
+++ b/packages/meshbay-hub/src/meshbay_hub/static/node-page.js
@@ -2,6 +2,7 @@ import {
html, useState, useEffect, useCallback, useRef,
} from './vendor/htm-preact.js';
import { t } from './i18n.js';
+import { ask } from './ask.js';
import * as platform from './platform.js';
import { Icon } from './icon.js';
import { HUB } from './hub-client.js';
@@ -286,7 +287,7 @@ export function NodePage({ groups, token, username }) {
}, [refresh]);
const removeRoot = useCallback(async (groupId, rootName) => {
- if (!confirm(t('node.root_remove_confirm', { name: rootName }))) return;
+ if (!await ask(t('node.root_remove_confirm', { name: rootName }))) return;
setBusy(true);
setActionMsg('');
try {
@@ -315,7 +316,7 @@ export function NodePage({ groups, token, username }) {
}, []);
const unpinMember = useCallback(async (userId) => {
- if (!confirm(t('node.unpin_confirm', { name: userId }))) return;
+ if (!await ask(t('node.unpin_confirm', { name: userId }))) return;
setBusy(true);
setActionMsg('');
try {
@@ -330,7 +331,7 @@ export function NodePage({ groups, token, username }) {
}, [rosterGroup, loadRoster]);
const rotateGek = useCallback(async (groupId) => {
- if (!confirm(t('node.gek_rotate_confirm'))) return;
+ if (!await ask(t('node.gek_rotate_confirm'))) return;
setBusy(true);
setActionMsg('');
try {
@@ -358,7 +359,7 @@ export function NodePage({ groups, token, username }) {
const clearDenylist = useCallback(async (subject) => {
const label = subject || t('node.denylist_clear_all');
- if (!confirm(t('node.denylist_clear_confirm', { subject: label }))) return;
+ if (!await ask(t('node.denylist_clear_confirm', { subject: label }))) return;
setBusy(true);
setActionMsg('');
try {
@@ -373,7 +374,7 @@ export function NodePage({ groups, token, username }) {
}, [loadDenylist]);
const detachGroup = useCallback(async (name) => {
- if (!confirm(t('node.detach_confirm', { name }))) return;
+ if (!await ask(t('node.detach_confirm', { name }))) return;
setBusy(true);
setActionMsg('');
try {
@@ -640,7 +641,7 @@ export function NodePage({ groups, token, username }) {
}, []);
const unpinNodeMember = useCallback(async (userId) => {
- if (!confirm(t('node.unpin_confirm', { name: userId }))) return;
+ if (!await ask(t('node.unpin_confirm', { name: userId }))) return;
setBusy(true);
setActionMsg('');
try {
@@ -655,7 +656,7 @@ export function NodePage({ groups, token, username }) {
}, [loadNodeRoster]);
const unlinkNode = useCallback(async () => {
- if (!confirm(t('node.unlink_confirm'))) return;
+ if (!await ask(t('node.unlink_confirm'))) return;
setUnlinkBusy(true);
setActionMsg('');
try {