gnome-shell/0001-appDisplay-fix-folder-loop-in-_ensureDefaultFolders.patch
2022-03-09 22:57:34 -08:00

34 lines
1.2 KiB
Diff

From e0aea6d883cbb5bc3a7a81f40fb450171e538676 Mon Sep 17 00:00:00 2001
From: Adam Williamson <awilliam@redhat.com>
Date: Wed, 9 Mar 2022 16:12:36 -0800
Subject: [PATCH 1/2] 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>
---
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 d8d0ff4f7..821bfe3b8 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',
--
2.35.1