mirror of
https://github.com/Equicord/Equicord.git
synced 2025-06-19 11:27:02 -04:00
feat(plugin): ShikiCodeblocks (#267)
Co-authored-by: ArjixWasTaken <53124886+ArjixWasTaken@users.noreply.github.com> Co-authored-by: Ven <vendicated@riseup.net>
This commit is contained in:
parent
4760af7f0e
commit
41dddc9eee
32 changed files with 1480 additions and 105 deletions
|
@ -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]) {
|
||||
|
|
|
@ -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]) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue