[gnome-shell/gbsneto/icon-grid-part1: 6/9] folderView: Make sure to only add icons once



commit 8ac23245f6ac5b719cd152a145fd4e898de7faf5
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Fri Jul 5 11:36:53 2019 -0300

    folderView: Make sure to only add icons once
    
    FolderView implementation currently allows for adding the same
    icon multiple times.
    
    Ensure the icon is not already added before adding it.
    
    https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/645

 js/ui/appDisplay.js | 3 +++
 1 file changed, 3 insertions(+)
---
diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js
index 15a271a2f..5030e1efa 100644
--- a/js/ui/appDisplay.js
+++ b/js/ui/appDisplay.js
@@ -1168,6 +1168,9 @@ var FolderView = class FolderView extends BaseAppView {
             if (!app.get_app_info().should_show())
                 return;
 
+            if (apps.some(appIcon => appIcon.id == appId))
+                return;
+
             let icon = new AppIcon(app);
             apps.push(icon);
         };


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