[gnome-shell] appDisplay: Fix folder loop in `_ensureDefaultFolders`



commit 0db64d3562b5ad3c0d297ab43e8b6374b2f5c49d
Author: Adam Williamson <awilliam redhat com>
Date:   Wed Mar 9 16:12:36 2022 -0800

    appDisplay: Fix folder loop in `_ensureDefaultFolders`
    
    In testing on Fedora, gnome-shell crashes here:
    
    JS ERROR: TypeError: DEFAULT_FOLDERS[folder] is undefined
    
    This needs to be a "for of" loop, not a "for in" loop, because
    `folders` is an array of the hash's keys, not the hash itself.
    
    Signed-off-by: Adam Williamson <awilliam redhat com>
    Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2238>

 js/ui/appDisplay.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js
index d8d0ff4f76..821bfe3b8d 100644
--- a/js/ui/appDisplay.js
+++ b/js/ui/appDisplay.js
@@ -1467,7 +1467,7 @@ class AppDisplay extends BaseAppView {
         this._folderSettings.set_strv('folder-children', folders);
 
         const { path } = this._folderSettings;
-        for (const folder in folders) {
+        for (const folder of folders) {
             const { name, categories, apps } = DEFAULT_FOLDERS[folder];
             const child = new Gio.Settings({
                 schema_id: 'org.gnome.desktop.app-folders.folder',


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