mirror of
https://github.com/System-End/Vencord.git
synced 2026-04-19 20:55:13 +00:00
fix Settings crash
This commit is contained in:
parent
46d41059b8
commit
189c00f014
1 changed files with 13 additions and 27 deletions
|
|
@ -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: () => <Component />,
|
||||
render: () => <Component />,
|
||||
};
|
||||
|
||||
// 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: () => <Icon width={20} height={20} />,
|
||||
buildLayout: () => [panel]
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue