Skip to content

Commit

Permalink
fix: Fix restored document not displayed in the folder view - EXO-77282
Browse files Browse the repository at this point in the history
… (#1352)

Prior to this change, restored documents weren't displayed in the document folder view. This issue was caused by the presence of the deleted document item in the local storage, which is used to handle the undo delete action. This change will remove the deleted document from the local storage after the dismissal of the confirm document delete alert, resolving this issue.
  • Loading branch information
sofyenne authored Mar 3, 2025
1 parent 6c9a8f3 commit eb053b3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ export default {
displayAlert() {
if (!this.displayAlert) {
this.$emit('dismissed');
document.dispatchEvent(new CustomEvent('document-alert-notification-dismissed'));
}
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ export default {
clickMessage,
});
}
document.addEventListener('document-alert-notification-dismissed', this.handleDocumentDeletionDismissal);
});
},
methods: {
Expand All @@ -73,6 +74,12 @@ export default {
});
});
},
handleDocumentDeletionDismissal() {
setTimeout(() => {
localStorage.removeItem('deletedDocument');
document.removeEventListener('document-alert-notification-dismissed', this.handleDocumentDeletionDismissal);
}, 2000);
}
},
};
</script>

0 comments on commit eb053b3

Please sign in to comment.