diff options
author | Justice Almanzar <superdash993@gmail.com> | 2022-12-02 10:43:37 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-02 16:43:37 +0100 |
commit | 41dddc9eee6f19fb5055545811aff1e282790a9c (patch) | |
tree | bf38148e87242e169adfa39919aa636a9d0551ce /src/plugins/pronoundb/components | |
parent | 4760af7f0ee275caa1eee440f4945032057d2b56 (diff) | |
download | Vencord-41dddc9eee6f19fb5055545811aff1e282790a9c.tar.gz Vencord-41dddc9eee6f19fb5055545811aff1e282790a9c.tar.bz2 Vencord-41dddc9eee6f19fb5055545811aff1e282790a9c.zip |
feat(plugin): ShikiCodeblocks (#267)
Co-authored-by: ArjixWasTaken <53124886+ArjixWasTaken@users.noreply.github.com>
Co-authored-by: Ven <vendicated@riseup.net>
Diffstat (limited to 'src/plugins/pronoundb/components')
-rw-r--r-- | src/plugins/pronoundb/components/PronounsChatComponent.tsx | 9 | ||||
-rw-r--r-- | src/plugins/pronoundb/components/PronounsProfileWrapper.tsx | 9 |
2 files changed, 8 insertions, 10 deletions
diff --git a/src/plugins/pronoundb/components/PronounsChatComponent.tsx b/src/plugins/pronoundb/components/PronounsChatComponent.tsx index 9225fc5..ce67754 100644 --- a/src/plugins/pronoundb/components/PronounsChatComponent.tsx +++ b/src/plugins/pronoundb/components/PronounsChatComponent.tsx @@ -39,11 +39,10 @@ export default function PronounsChatComponentWrapper({ message }: { message: Mes } function PronounsChatComponent({ message }: { message: Message; }) { - const [result, , isPending] = useAwaiter( - () => fetchPronouns(message.author.id), - null, - e => console.error("Fetching pronouns failed: ", e) - ); + const [result, , isPending] = useAwaiter(() => fetchPronouns(message.author.id), { + fallbackValue: null, + onError: e => console.error("Fetching pronouns failed: ", e) + }); // If the promise completed, the result was not "unspecified", and there is a mapping for the code, then return a span with the pronouns if (!isPending && result && result !== "unspecified" && PronounMapping[result]) { diff --git a/src/plugins/pronoundb/components/PronounsProfileWrapper.tsx b/src/plugins/pronoundb/components/PronounsProfileWrapper.tsx index 9540bb9..79fce23 100644 --- a/src/plugins/pronoundb/components/PronounsProfileWrapper.tsx +++ b/src/plugins/pronoundb/components/PronounsProfileWrapper.tsx @@ -45,11 +45,10 @@ function ProfilePronouns( leProps: UserProfilePronounsProps; } ) { - const [result, , isPending] = useAwaiter( - () => fetchPronouns(userId), - null, - e => console.error("Fetching pronouns failed: ", e) - ); + const [result, , isPending] = useAwaiter(() => fetchPronouns(userId), { + fallbackValue: null, + onError: e => console.error("Fetching pronouns failed: ", e), + }); // If the promise completed, the result was not "unspecified", and there is a mapping for the code, then render if (!isPending && result && result !== "unspecified" && PronounMapping[result]) { |