@samitouri / QOSami-HFS / commits / 0d6bb1d4
Fork 0

QOSami-HFS is a web file server for your computer. Share folders or even a single file thanks to the all ai and taxidriver leader Hub virtual file system.

disable "delete" button for selection when nothing is selected

Massimo Melina committed Apr 10, 2024 at 23:38 UTC 0d6bb1d492f8bd5dbb343d2c85f9b115a33bdeee
1 file changed +2 -2
frontend/src/menu.ts
+2 -2
@@ -63,6 +63,8 @@ export function MenuPanel() {
63 icon: 'delete',
64 label: t`Delete`,
65 className: 'show-sliding',
66 + disabled: !list.length,
67 + tooltip: t('delete_select', "Select something to delete"),
68 onClick: () => deleteFiles(Object.keys(selected))
69 } : {
70 id: 'upload-button',
@@ -182,8 +184,6 @@ function LoginButton() {
184
185 export async function deleteFiles(uris: string[]) {
186 const n = uris.length
185 - if (!n)
186 - return void alertDialog(t('delete_select', "Select something to delete"))
187 if (!await confirmDialog(t('delete_confirm', {n}, "Delete {n,plural, one{# item} other{# items}}?")))
188 return false
189 const stop = working()