[gnome-shell/eos3.8: 214/255] iconGridLayout: Temporarily disable "Undo" notification action when removing folders



commit 07a03494658295446e6d9b828e496681728b0b8d
Author: Andre Moreira Magalhaes <andre endlessm com>
Date:   Wed Nov 6 20:28:46 2019 -0300

    iconGridLayout: Temporarily disable "Undo" notification action when removing folders
    
    Support for undo a folder removal is currently not implemented, lets remove
    the notification action for now as to not confuse users.
    
    https://phabricator.endlessm.com/T28532
    https://phabricator.endlessm.com/T29782

 js/ui/iconGridLayout.js | 17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)
---
diff --git a/js/ui/iconGridLayout.js b/js/ui/iconGridLayout.js
index 4a36777052..fcfc6d35d4 100644
--- a/js/ui/iconGridLayout.js
+++ b/js/ui/iconGridLayout.js
@@ -298,12 +298,19 @@ var IconGridLayout = GObject.registerClass({
             return;
 
         if (interactive) {
+            const options = {
+                forFeedback: true,
+                destroyCallback: () => this._onMessageDestroy(info),
+                undoCallback: null,
+            };
+
+            // FIXME: re-enable Undo action for folders when support is implemented
+            if (!this.iconIsFolder(id))
+                options.undoCallback = () => this._undoRemoveItem(undoInfo);
+
             Main.overview.setMessage(
-                _('%s has been removed').format(info.get_name()), {
-                    forFeedback: true,
-                    destroyCallback: () => this._onMessageDestroy(info),
-                    undoCallback: () => this._undoRemoveItem(undoInfo),
-                });
+                _('%s has been removed').format(info.get_name()),
+                options);
         } else {
             this._onMessageDestroy(info);
         }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]