mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-01-31 05:19:53 +00:00
Assign default category Others (#339)
* Assign default category Others * nit
This commit is contained in:
@@ -30,9 +30,23 @@ export const useSettingStore = defineStore('setting', {
|
||||
}),
|
||||
getters: {
|
||||
settingTree(): SettingTreeNode {
|
||||
return buildTree(Object.values(this.settings), (setting: SettingParams) =>
|
||||
setting.id.split('.')
|
||||
const root = buildTree(
|
||||
Object.values(this.settings),
|
||||
(setting: SettingParams) => setting.id.split('.')
|
||||
)
|
||||
|
||||
const floatingSettings = root.children.filter((node) => node.leaf)
|
||||
if (floatingSettings.length) {
|
||||
root.children = root.children.filter((node) => !node.leaf)
|
||||
root.children.push({
|
||||
key: 'Other',
|
||||
label: 'Other',
|
||||
leaf: false,
|
||||
children: floatingSettings
|
||||
})
|
||||
}
|
||||
|
||||
return root
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
|
||||
Reference in New Issue
Block a user