1
0
Fork 0

fix: clear alert message after sending

dufisgsd
Lea 2023-08-09 22:26:10 +02:00
parent 1f116d4e37
commit 78632d4a48
Signed by: lea
GPG Key ID: 1BAFFE8347019C42
1 changed files with 4 additions and 1 deletions

View File

@ -316,7 +316,10 @@ export function UserActions({ user, bot }: { user: User; bot?: Bot }) {
if (!alertMessage.current) return;
sendAlert(user._id, alertMessage.current)
.then(() => toast({ title: "Sent Alert" }))
.then(() => {
toast({ title: "Sent Alert" });
alertMessage.current = "";
})
.catch((err) =>
toast({
title: "Failed to send alert!",