mirror of
https://github.com/hexastack/hexabot
synced 2025-01-22 18:45:57 +00:00
fix: error toast
This commit is contained in:
parent
1d72732fad
commit
37b4629466
@ -41,7 +41,11 @@ const TOAST_WARNING_STYLE = {
|
||||
export const useToast = () => {
|
||||
const { t } = useTranslation();
|
||||
const extractErrorMessage = (error: any) => {
|
||||
if (error?.statusCode == 409) {
|
||||
if(typeof error === 'string') {
|
||||
return error;
|
||||
}
|
||||
|
||||
else if (error?.statusCode == 409) {
|
||||
return t("message.duplicate_error");
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user