aboutsummaryrefslogtreecommitdiff
path: root/src/plugins/pronoundb/components/PronounsChatComponent.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/pronoundb/components/PronounsChatComponent.tsx')
-rw-r--r--src/plugins/pronoundb/components/PronounsChatComponent.tsx16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/plugins/pronoundb/components/PronounsChatComponent.tsx b/src/plugins/pronoundb/components/PronounsChatComponent.tsx
index 78cee48..57033cc 100644
--- a/src/plugins/pronoundb/components/PronounsChatComponent.tsx
+++ b/src/plugins/pronoundb/components/PronounsChatComponent.tsx
@@ -27,12 +27,18 @@ import { PronounMapping } from "../types";
const styles: Record<string, string> = lazyWebpack(filters.byProps("timestampInline"));
-export default function PronounsChatComponent({ message }: { message: Message; }) {
+export default function PronounsChatComponentWrapper({ message }: { message: Message; }) {
// Don't bother fetching bot or system users
- if (message.author.bot || message.author.system) return null;
+ if (message.author.bot || message.author.system)
+ return null;
// Respect showSelf options
- if (!Settings.plugins.PronounDB.showSelf && message.author.id === UserStore.getCurrentUser().id) return null;
+ if (!Settings.plugins.PronounDB.showSelf && message.author.id === UserStore.getCurrentUser().id)
+ return null;
+ return <PronounsChatComponent message={message} />;
+}
+
+function PronounsChatComponent({ message }: { message: Message; }) {
const [result, , isPending] = useAwaiter(
() => fetchPronouns(message.author.id),
null,
@@ -47,6 +53,6 @@ export default function PronounsChatComponent({ message }: { message: Message; }
>• {formatPronouns(result)}</span>
);
}
- // Otherwise, return null so nothing else is rendered
- else return null;
+
+ return null;
}