Skip to content

Commit

Permalink
Creating view trash and more restore options
Browse files Browse the repository at this point in the history
  • Loading branch information
subhas-pramanik-09 committed Jan 17, 2025
1 parent a6f5608 commit 3f0ad58
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions js/activity.js
Original file line number Diff line number Diff line change
Expand Up @@ -3340,8 +3340,9 @@ class Activity {
);
return;
}
const lastId = this.blocks.trashStacks[this.blocks.trashStacks.length - 1];
if (lastId) this._restoreTrashById(lastId);
for(let i=this.blocks.trashStacks.length - 1;i<this.blocks.trashStacks.length;i++){
this._restoreTrashById(this.blocks.trashStacks[i]);
}
activity.textMsg(
_("Item restored from the trash."),
3000
Expand Down Expand Up @@ -3469,8 +3470,9 @@ class Activity {
restoreLastIcon.classList.add('restore-last-icon');
restoreLastIcon.innerHTML = '<i class="material-icons md-48">restore_from_trash</i>';
restoreLastIcon.addEventListener('click', () => {
const lastId = this.blocks.trashStacks[this.blocks.trashStacks.length - 1];
if (lastId) this._restoreTrashById(lastId);
for(let i=this.blocks.trashStacks.length - 1;i<this.blocks.trashStacks.length;i++){
this._restoreTrashById(this.blocks.trashStacks[i]);
}
trashView.classList.add('hidden');
});

Expand Down

0 comments on commit 3f0ad58

Please sign in to comment.