aboutsummaryrefslogtreecommitdiffstats
path: root/packages/meshbay-hub/src/meshbay_hub/static/playlist-menu.js
diff options
context:
space:
mode:
Diffstat (limited to 'packages/meshbay-hub/src/meshbay_hub/static/playlist-menu.js')
-rw-r--r--packages/meshbay-hub/src/meshbay_hub/static/playlist-menu.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/packages/meshbay-hub/src/meshbay_hub/static/playlist-menu.js b/packages/meshbay-hub/src/meshbay_hub/static/playlist-menu.js
index 64d1c62..a65d26d 100644
--- a/packages/meshbay-hub/src/meshbay_hub/static/playlist-menu.js
+++ b/packages/meshbay-hub/src/meshbay_hub/static/playlist-menu.js
@@ -2,6 +2,7 @@ import {
html, useState, useCallback, useEffect,
} from './vendor/htm-preact.js';
import { t } from './i18n.js';
+import { ask } from './ask.js';
import { Icon } from './icon.js';
import { Menu, useMenu } from './menu.js';
import * as P from './playlists.js';
@@ -123,10 +124,9 @@ function PlaylistMenuButton({ userId, lists, reload, onPlayQueue, onSync, cached
}, [userId, reload, say]);
const deletePlaylist = useCallback(async (p) => {
- // `confirm` and not a component: Electron implements it, a dozen places in
- // this SPA already use it, and a deletion is a tombstone rather than
- // something that can be undone from the interface.
- if (!window.confirm(t('playlists.confirm_delete', { name: p.name }))) return;
+ // Asked first: a deletion is a tombstone rather than something that can be
+ // undone from the interface.
+ if (!await ask(t('playlists.confirm_delete', { name: p.name }))) return;
await P.deletePlaylist(userId, p.id);
await reload();
say(t('playlists.deleted', { name: p.name }));