From 92ac4036797c5db333d486ecee1eb3037495d416 Mon Sep 17 00:00:00 2001 From: Chenlei Hu Date: Sat, 26 Oct 2024 17:07:17 -0400 Subject: [PATCH] Enable ts-strict for settingStore (#1322) --- src/stores/settingStore.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/stores/settingStore.ts b/src/stores/settingStore.ts index 220271233..9cc70bd7c 100644 --- a/src/stores/settingStore.ts +++ b/src/stores/settingStore.ts @@ -1,4 +1,3 @@ -// @ts-strict-ignore /** * TODO: Migrate scripts/ui/settings.ts here * @@ -42,9 +41,9 @@ export const useSettingStore = defineStore('setting', { (setting: SettingParams) => setting.category || setting.id.split('.') ) - const floatingSettings = root.children.filter((node) => node.leaf) + const floatingSettings = (root.children ?? []).filter((node) => node.leaf) if (floatingSettings.length) { - root.children = root.children.filter((node) => !node.leaf) + root.children = (root.children ?? []).filter((node) => !node.leaf) root.children.push({ key: 'Other', label: 'Other',