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



commit a690b24893b74d6dd1973bc011dfd4dd5c4fdb07
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 c0358a414..bcd1c8f68 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]