From a6ad7b69af6bff906a976e32dafe87567207fcfd Mon Sep 17 00:00:00 2001 From: subhas-pramanik-09 Date: Fri, 6 Dec 2024 20:30:14 +0530 Subject: [PATCH] popup msg for restore items --- js/activity.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/js/activity.js b/js/activity.js index 2622ecff2c..1c0de1de6b 100644 --- a/js/activity.js +++ b/js/activity.js @@ -3222,7 +3222,19 @@ class Activity { * Repositions blocks about trash area */ const restoreTrash = (activity) => { + if (!activity.blocks || !activity.blocks.trashStacks || activity.blocks.trashStacks.length === 0) { + activity.textMsg( + _("Nothing in the trash to restore."), + 3000 + ); + return; + } activity._restoreTrash(); + activity.textMsg( + _("Item restored from the trash."), + 3000 + ); + if (docById("helpfulWheelDiv").style.display !== "none") { docById("helpfulWheelDiv").style.display = "none"; activity.__tick(); @@ -7062,4 +7074,4 @@ define(MYDEFINES, (compatibility) =>{ activity.setupDependencies(); activity.doContextMenus(); activity.doPluginsAndPaletteCols(); -}); +}); \ No newline at end of file