forked from administration/panel
fix: remove unnecessary toast description
parent
a896884593
commit
1d8bc5f301
|
@ -88,9 +88,6 @@ export function UserActions({ user, bot }: { user: User; bot?: Bot }) {
|
|||
setUserDraft((user) => ({ ...user!, badges }));
|
||||
toast({
|
||||
title: "Updated user badges",
|
||||
description: result.updatePublished
|
||||
? undefined
|
||||
: "Failed to publish event, users will need to reload to see the change",
|
||||
});
|
||||
} catch (err) {
|
||||
toast({
|
||||
|
@ -258,17 +255,11 @@ export function UserActions({ user, bot }: { user: User; bot?: Bot }) {
|
|||
|
||||
<AlertDialog>
|
||||
<AlertDialogTrigger asChild>
|
||||
<Button
|
||||
className="flex-1 bg-yellow-600"
|
||||
>
|
||||
Bees
|
||||
</Button>
|
||||
<Button className="flex-1 bg-yellow-600">Bees</Button>
|
||||
</AlertDialogTrigger>
|
||||
<AlertDialogContent>
|
||||
<AlertDialogHeader>
|
||||
<AlertDialogTitle>
|
||||
Release the bees
|
||||
</AlertDialogTitle>
|
||||
<AlertDialogTitle>Release the bees</AlertDialogTitle>
|
||||
<AlertDialogDescription>
|
||||
Are you sure you want to send the bees?
|
||||
</AlertDialogDescription>
|
||||
|
@ -342,23 +333,46 @@ export function UserActions({ user, bot }: { user: User; bot?: Bot }) {
|
|||
</AlertDialogTrigger>
|
||||
<AlertDialogContent>
|
||||
<AlertDialogHeader>
|
||||
<AlertDialogTitle>
|
||||
Reset user profile
|
||||
</AlertDialogTitle>
|
||||
<AlertDialogTitle>Reset user profile</AlertDialogTitle>
|
||||
<AlertDialogDescription>
|
||||
<Checkbox checked={wipeDraft.avatar} onChange={(e) => setWipeDraft({ ...wipeDraft, avatar: e == true })}>
|
||||
<Checkbox
|
||||
checked={wipeDraft.avatar}
|
||||
onChange={(e) =>
|
||||
setWipeDraft({ ...wipeDraft, avatar: e == true })
|
||||
}
|
||||
>
|
||||
Avatar
|
||||
</Checkbox>
|
||||
<Checkbox checked={wipeDraft.banner} onChange={(e) => setWipeDraft({ ...wipeDraft, banner: e == true })}>
|
||||
<Checkbox
|
||||
checked={wipeDraft.banner}
|
||||
onChange={(e) =>
|
||||
setWipeDraft({ ...wipeDraft, banner: e == true })
|
||||
}
|
||||
>
|
||||
Profile Banner
|
||||
</Checkbox>
|
||||
<Checkbox checked={wipeDraft.displayName} onChange={(e) => setWipeDraft({ ...wipeDraft, displayName: e == true })}>
|
||||
<Checkbox
|
||||
checked={wipeDraft.displayName}
|
||||
onChange={(e) =>
|
||||
setWipeDraft({ ...wipeDraft, displayName: e == true })
|
||||
}
|
||||
>
|
||||
Display Name
|
||||
</Checkbox>
|
||||
<Checkbox checked={wipeDraft.bio} onChange={(e) => setWipeDraft({ ...wipeDraft, bio: e == true })}>
|
||||
<Checkbox
|
||||
checked={wipeDraft.bio}
|
||||
onChange={(e) =>
|
||||
setWipeDraft({ ...wipeDraft, bio: e == true })
|
||||
}
|
||||
>
|
||||
Bio
|
||||
</Checkbox>
|
||||
<Checkbox checked={wipeDraft.status} onChange={(e) => setWipeDraft({ ...wipeDraft, status: e == true })}>
|
||||
<Checkbox
|
||||
checked={wipeDraft.status}
|
||||
onChange={(e) =>
|
||||
setWipeDraft({ ...wipeDraft, status: e == true })
|
||||
}
|
||||
>
|
||||
Status
|
||||
</Checkbox>
|
||||
</AlertDialogDescription>
|
||||
|
@ -366,27 +380,33 @@ export function UserActions({ user, bot }: { user: User; bot?: Bot }) {
|
|||
<AlertDialogFooter>
|
||||
<AlertDialogCancel>Cancel</AlertDialogCancel>
|
||||
<AlertDialogAction
|
||||
disabled={!Object.values(wipeDraft).filter(i => i).length}
|
||||
disabled={!Object.values(wipeDraft).filter((i) => i).length}
|
||||
onClick={() => {
|
||||
wipeUserProfile(user._id, wipeDraft)
|
||||
.then(() => {
|
||||
toast({ title: "Wiped selected fields" });
|
||||
window.location.reload();
|
||||
})
|
||||
.catch((e) => toast({
|
||||
.catch((e) =>
|
||||
toast({
|
||||
title: "Failed to wipe profile",
|
||||
description: String(e),
|
||||
variant: "destructive",
|
||||
}))
|
||||
.finally(() => setWipeDraft({
|
||||
})
|
||||
)
|
||||
.finally(() =>
|
||||
setWipeDraft({
|
||||
avatar: false,
|
||||
banner: false,
|
||||
bio: false,
|
||||
displayName: false,
|
||||
status: false,
|
||||
}));
|
||||
})
|
||||
);
|
||||
}}
|
||||
>Reset</AlertDialogAction>
|
||||
>
|
||||
Reset
|
||||
</AlertDialogAction>
|
||||
</AlertDialogFooter>
|
||||
</AlertDialogContent>
|
||||
</AlertDialog>
|
||||
|
|
Loading…
Reference in New Issue