Skip to content

Commit

Permalink
fix(JoinButton): simplify toast and fix the join flow
Browse files Browse the repository at this point in the history
  • Loading branch information
BrickheadJohnny committed Dec 5, 2024
1 parent 755af6d commit 99798ef
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/app/(dashboard)/[guildUrlName]/components/JoinButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export const JoinButton = () => {
sseMessage.data,
// biome-ignore lint/suspicious/noExplicitAny: TODO: fill missing types
) as any;
if (status === "complete") {
if (status === "Completed") {
if (data === undefined) {
throw new Error(
"Server responded with success, but returned no user",
Expand All @@ -63,11 +63,9 @@ export const JoinButton = () => {
} else if (status === "error") {
reject();
}
const toastFunction =
status === "complete" ? toast.success : toast.info;
toastFunction(status, {

toast(status, {
description: message,
richColors: status === "complete",
});
} catch (e) {
console.warn("JSON parsing failed on join event stream", e);
Expand Down

0 comments on commit 99798ef

Please sign in to comment.