Skip to content
This repository has been archived by the owner on Jul 29, 2024. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
verticalsync committed Mar 2, 2024
2 parents 5af53b8 + d61f552 commit 51feea1
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 6 deletions.
9 changes: 8 additions & 1 deletion src/suncordplugins/Anammox/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
/*
* Vencord, a Discord client mod
* Copyright (c) 2024 Vendicated and contributors
* SPDX-License-Identifier: GPL-3.0-or-later
*/

import { definePluginSettings } from "@api/Settings";
import { Devs } from "@utils/constants";
import definePlugin, { OptionType } from "@utils/types";

export const settings = definePluginSettings({
Expand Down Expand Up @@ -31,7 +38,7 @@ export const settings = definePluginSettings({
export default definePlugin({
name: "Anammox",
description: "A microbial process that plays an important part in the nitrogen cycle",
authors: [{ id: 236588665420251137n, name: "Kyuuhachi" }],
authors: [Devs.Kyuuhachi],
settings,

patches: [
Expand Down
19 changes: 14 additions & 5 deletions src/suncordplugins/FastMenu/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
/*
* Vencord, a Discord client mod
* Copyright (c) 2024 Vendicated and contributors
* SPDX-License-Identifier: GPL-3.0-or-later
*/

import { definePluginSettings } from "@api/Settings";
import { classNameFactory } from "@api/Styles";
import { Devs } from "@utils/constants";
import definePlugin, { OptionType } from "@utils/types";
import { findByPropsLazy, wreq } from "@webpack";
import { ComponentDispatch, Forms, useEffect, useRef } from "@webpack/common";
Expand All @@ -14,20 +21,21 @@ const settings = definePluginSettings({
type: OptionType.BOOLEAN,
default: true,
onChange(val) {
if(val) eagerLoad();
if (val) eagerLoad();
}
},
});

const lazyLayers: string[] = [];
function eagerLoad() {
// @ts-ignore
lazyLayers.forEach(wreq.el);
}

export default definePlugin({
name: "FastMenu",
description: "Makes the settings menu open faster.",
authors: [{ id: 236588665420251137n, name: "Kyuuhachi" }],
authors: [Devs.Kyuuhachi],
settings,

patches: [
Expand Down Expand Up @@ -83,17 +91,18 @@ export default definePlugin({
style={{ visibility: hidden ? "hidden" : "visible" }}
{...props}
/>;
if(baseLayer) return node;
if (baseLayer) return node;
// @ts-ignore
else return <Forms.FocusLock containerRef={containerRef}>{node}</Forms.FocusLock>;
},

lazyLayer(moduleId: string, name: string) {
if(name !== "CollectiblesShop")
if (name !== "CollectiblesShop")
lazyLayers.push(moduleId);
},

start() {
if(settings.store.eagerLoad)
if (settings.store.eagerLoad)
eagerLoad();
},
});

0 comments on commit 51feea1

Please sign in to comment.