From adc0d2f0d75999a4768e65e8c217446bcaf177d2 Mon Sep 17 00:00:00 2001 From: programminglaboratorys Date: Sat, 28 Sep 2024 01:03:40 +0300 Subject: [PATCH] minor tweaks --- src/plugins/statusPresets/index.tsx | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/plugins/statusPresets/index.tsx b/src/plugins/statusPresets/index.tsx index b8e16d2c4..8998ed143 100644 --- a/src/plugins/statusPresets/index.tsx +++ b/src/plugins/statusPresets/index.tsx @@ -22,7 +22,7 @@ import ErrorBoundary from "@components/ErrorBoundary"; import { Devs } from "@utils/constants"; import definePlugin, { OptionType, StartAt } from "@utils/types"; import { findByPropsLazy, findComponentByCodeLazy } from "@webpack"; -import { Button, Clickable, Icons, Menu, Text, Toasts, useState } from "@webpack/common"; +import { Button, Clickable, Icons, Menu, Toasts, useState } from "@webpack/common"; // const { PMenu } = mapMangledModuleLazy("{id:t,label:n,icon:c,hint:_,renderSubmenu:E,...h}", { // PMenu: filters.byCode("{id:t,label:n,icon:c,hint:_,renderSubmenu:E,...h}") @@ -36,8 +36,9 @@ const PSubMenu = findComponentByCodeLazy("submenuPaddingContainer,children:(0,i. const Components = findByPropsLazy("Status"); const StatusStyles = findByPropsLazy("statusItem"); + const statusSettings = getUserSettingLazy("status", "status"); -const customStatusSettings = getUserSettingLazy("status", "status"); +const customStatusSettings = getUserSettingLazy("status", "customStatus"); interface Emoji { @@ -56,10 +57,8 @@ interface DiscordStatus { const settings = definePluginSettings({ StatusPresets: { type: OptionType.COMPONENT, - description: "yaps", - component: () => { - return (yo); - }, + description: "Status Presets", + component: () => <>, default: {} } }); @@ -124,7 +123,7 @@ export default definePlugin({ description: "do now and think later", authors: [Devs.Dolfies], settings: settings, - dependencies: ["ContextMenuAPI", "UserSettingsAPI"], + dependencies: ["UserSettingsAPI"], patches: [ { find: ".Messages.CUSTOM_STATUS_CLEAR_AFTER", @@ -141,20 +140,21 @@ export default definePlugin({ } } ], - render(status, openStatusModal_: () => void, OnClose: () => void) { - const openStatusModal = () => { OnClose(), openStatusModal_(); }; + render(status, openStatusModal: () => void, OnClose: () => void) { + if (!customStatusSettings) return; + const openModal = () => { OnClose(); openStatusModal(); }; return
{status == null ?
} label="Set Custom Status" renderSubmenu={StatusSubMenuComponent} /> : customStatusSettings.updateSetting(null)}>} + onClick={openModal} + hint={ customStatusSettings.updateSetting(null)}>} icon={() => status.emoji != null ? : null} label="Edit Custom Status" renderSubmenu={StatusSubMenuComponent} />} ;