diff --git a/src/plugins/statusPresets/index.tsx b/src/plugins/statusPresets/index.tsx
index 970a31c03..edb830661 100644
--- a/src/plugins/statusPresets/index.tsx
+++ b/src/plugins/statusPresets/index.tsx
@@ -54,15 +54,15 @@ const EmojiComponent = findComponentByCodeLazy(".translateSurrogatesToInlineEmoj
const customStatusSettings = getUserSettingLazy("status", "customStatus");
-const ClearStatusButton = () => customStatusSettings?.updateSetting(null)}>;
+const ClearStatusButton = () => customStatusSettings?.updateSetting(null)}>;
function StatusIcon({ isHovering, status }: { isHovering: boolean; status: DiscordStatus; }) {
return
{isHovering ?
-
+
: (status.emojiInfo != null ?
:
)}
;
}
-const RenderStatusMenuItem = ({ status }: { status: DiscordStatus; }) => {
+const RenderStatusMenuItem = ({ status, forceRerender }: { status: DiscordStatus; forceRerender: ()=>void}) => {
const [isHovering, setIsHovering] = useState(false);
const handleMouseOver = () => {
setIsHovering(true);
@@ -75,13 +75,14 @@ const RenderStatusMenuItem = ({ status }: { status: DiscordStatus; }) => {
return
{
delete settings.store.StatusPresets[status.text];
+ forceRerender();
Toasts.show({
message: "Successfully removed Status",
type: Toasts.Type.SUCCESS,
@@ -94,12 +95,14 @@ const RenderStatusMenuItem = ({ status }: { status: DiscordStatus; }) => {
const StatusSubMenuComponent = () => {
+ const [, forceUpdate] = useState(0);
+ const forceRerender = () => forceUpdate(v => v + 1);
return { }}>
{Object.entries((settings.store.StatusPresets as { [k: string]: DiscordStatus; })).map(([index, status]) => setStatus(status.text, status.emojiInfo, status.clearAfter, { "location": { "section": "Account Panel", "object": "Avatar" } })}
- render={() => }
+ render={() => }
/>)}
;
};