Add undo to drag-drop trash. Fix toast undo button visibility (darker bg, border, max-width).
This commit is contained in:
@@ -1326,10 +1326,13 @@ if (token && curUser) {
|
||||
if (!id) return;
|
||||
const ids = selectedIds.has(id) && selectedIds.size > 1 ? [...selectedIds] : [id];
|
||||
for (const sid of ids) await delEntry(sid, true);
|
||||
toast('📦 Moved ' + ids.length + ' entries to trash');
|
||||
playSound('delete');
|
||||
clearSelection();
|
||||
await loadEntries();
|
||||
toast('📦 Moved ' + ids.length + ' entries to trash', 'success', {
|
||||
label: '↩ Undo',
|
||||
cb: async () => { for (const sid of ids) await restoreEntry(sid, true); await loadEntries(); toast('↩ Restored ' + ids.length + ' entries'); playSound('success'); }
|
||||
});
|
||||
playSound('delete');
|
||||
});
|
||||
}
|
||||
})();
|
||||
|
||||
Reference in New Issue
Block a user