From 189c00f0142c96d3cbb49b680291559d2792ef9b Mon Sep 17 00:00:00 2001 From: Vendicated Date: Tue, 10 Mar 2026 23:27:46 +0100 Subject: [PATCH] fix Settings crash --- src/plugins/_core/settings.tsx | 40 +++++++++++----------------------- 1 file changed, 13 insertions(+), 27 deletions(-) diff --git a/src/plugins/_core/settings.tsx b/src/plugins/_core/settings.tsx index c1781edf..01a57f78 100644 --- a/src/plugins/_core/settings.tsx +++ b/src/plugins/_core/settings.tsx @@ -32,9 +32,10 @@ let LayoutTypes = { SECTION: 1, SIDEBAR_ITEM: 2, PANEL: 3, - PANE: 4 + CATEGORY: 5, + CUSTOM: 19, }; -waitFor(["SECTION", "SIDEBAR_ITEM", "PANEL"], v => LayoutTypes = v); +waitFor(["SECTION", "SIDEBAR_ITEM", "PANEL", "CUSTOM"], v => LayoutTypes = v); const FallbackSectionTypes = { HEADER: "HEADER", @@ -157,36 +158,21 @@ export default definePlugin({ key: key + "_panel", type: LayoutTypes.PANEL, useTitle: () => panelTitle, + buildLayout: () => [{ + type: LayoutTypes.CATEGORY, + key: key + "_category", + buildLayout: () => [{ + type: LayoutTypes.CUSTOM, + key: key + "_custom", + Component: Component, + useSearchTerms: () => [title] + }] + }] }; - const render = { - // FIXME - StronglyDiscouragedCustomComponent: () => , - render: () => , - }; - - // FIXME - if (LayoutTypes.PANE) { - panel.buildLayout = () => [ - { - key: key + "_pane", - type: LayoutTypes.PANE, - useTitle: () => panelTitle, - buildLayout: () => [], - ...render - } - ]; - } else { - Object.assign(panel, render); - panel.buildLayout = () => []; - } - return ({ key, type: LayoutTypes.SIDEBAR_ITEM, - // FIXME - legacySearchKey: title.toUpperCase(), - getLegacySearchKey: () => title.toUpperCase(), useTitle: () => title, icon: () => , buildLayout: () => [panel]