1
0
Fork 1
mirror of https://github.com/Vendicated/Vencord.git synced 2025-01-10 09:56:24 +00:00

fix settings issue

This commit is contained in:
programminglaboratorys 2024-10-01 23:07:09 +03:00
parent 5c0f1601c2
commit c7077de005

View file

@ -97,7 +97,7 @@ const RenderStatusMenuItem = ({ status, forceRerender, disabled }: { status: Dis
<Clickable <Clickable
onClick={e => { onClick={e => {
e.stopPropagation(); e.stopPropagation();
delete settings.store.StatusPresets[status.text]; settings.store.StatusPresets[status.text] = undefined; // setting to undefined to remove it.
forceRerender(); forceRerender();
}}><StatusIcon isHovering={isHovering} status={status} /></Clickable> }}><StatusIcon isHovering={isHovering} status={status} /></Clickable>
<div className={StatusStyles.status} style={{ marginLeft: "2px" }}>{status.text}</div> <div className={StatusStyles.status} style={{ marginLeft: "2px" }}>{status.text}</div>
@ -109,7 +109,7 @@ const StatusSubMenuComponent = () => {
const [, forceUpdate] = useState(0); const [, forceUpdate] = useState(0);
const forceRerender = () => forceUpdate(v => v + 1); const forceRerender = () => forceUpdate(v => v + 1);
return <Menu.Menu navId="sp-custom-status-submenu" onClose={() => { }}> return <Menu.Menu navId="sp-custom-status-submenu" onClose={() => { }}>
{Object.entries((settings.store.StatusPresets as { [k: string]: DiscordStatus; })).map(([index, status]) => <Menu.MenuItem {Object.entries((settings.store.StatusPresets as { [k: string]: DiscordStatus | undefined; })).map(([index, status]) => status != null ? <Menu.MenuItem
id={"status-presets-" + index} id={"status-presets-" + index}
label={status.status} label={status.status}
action={() => (status.emojiInfo?.id != null && UserStore.getCurrentUser().hasPremiumPerks || status.emojiInfo?.id == null) && setStatus(status)} action={() => (status.emojiInfo?.id != null && UserStore.getCurrentUser().hasPremiumPerks || status.emojiInfo?.id == null) && setStatus(status)}
@ -118,7 +118,7 @@ const StatusSubMenuComponent = () => {
forceRerender={forceRerender} forceRerender={forceRerender}
disabled={status.emojiInfo?.id != null && !UserStore.getCurrentUser().hasPremiumPerks} disabled={status.emojiInfo?.id != null && !UserStore.getCurrentUser().hasPremiumPerks}
/>} />}
/>)} /> : null)}
</Menu.Menu>; </Menu.Menu>;
}; };