v2.3 Papierkorb: Bookmark-Loeschen in den Papierkorb umleiten
This commit is contained in:
+10
-1
@@ -254,12 +254,21 @@ function bindBoardListEvents(list, board) {
|
||||
const bmItem = e.target.closest('.bm-item');
|
||||
if (!bmItem) return;
|
||||
|
||||
// Delete-Button geklickt
|
||||
// Delete-Button geklickt: kein Confirm (wie bisher), aber nicht mehr hart loeschen —
|
||||
// das Bookmark wandert in den Papierkorb (30 Tage, TRASH-01). Erst per find() greifen,
|
||||
// dann mit Herkunft (originBoardId), type und Zeitstempel ins trash[] pushen.
|
||||
if (e.target.closest('.bm-delete')) {
|
||||
e.stopPropagation();
|
||||
const bmId = bmItem.dataset.bmId;
|
||||
const removed = board.bookmarks.find(b => b.id === bmId);
|
||||
if (removed) {
|
||||
// Datensicherheit: ZUERST den Trash-Klon persistieren, DANN die Loeschung committen.
|
||||
// Falls saveTrash() (Quota) rejectet, ist das Original noch in boards[] -> kein Verlust.
|
||||
pushToTrash({ item: removed, type: 'bookmark', originBoardId: board.id });
|
||||
await saveTrash();
|
||||
board.bookmarks = board.bookmarks.filter(b => b.id !== bmId);
|
||||
await saveBoards();
|
||||
}
|
||||
renderBoards();
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user