fix: signin error notification is not shown (#2908)

fix signin error notification is not shown
This commit is contained in:
Athurg Gooth 2024-02-04 14:25:51 +08:00 committed by GitHub
parent 82e72813f9
commit b8a9783db5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,4 +1,5 @@
import { Button, Checkbox, Divider, Input } from "@mui/joy";
import { ClientError } from "nice-grpc-web";
import { useEffect, useState } from "react";
import { toast } from "react-hot-toast";
import { Link } from "react-router-dom";
@ -85,7 +86,7 @@ const SignIn = () => {
}
} catch (error: any) {
console.error(error);
toast.error(error.response.data.message || t("message.login-failed"));
toast.error((error as ClientError).details || t("message.login-failed"));
}
actionBtnLoadingState.setFinish();
};