mirror of
https://github.com/QuivrHQ/quivr.git
synced 2024-12-15 09:32:22 +03:00
feat: add name missing error in new brain modal (#1055)
* feat: update toast z index * feat(brain modal): add name missing message
This commit is contained in:
parent
bcf954135c
commit
5612c2b455
@ -59,6 +59,11 @@ export const useAddBrainModal = () => {
|
||||
const { name, description, setDefault } = getValues();
|
||||
|
||||
if (name.trim() === "" || isPending) {
|
||||
publish({
|
||||
variant: "danger",
|
||||
text: t("nameRequired", { ns: "config" }),
|
||||
});
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@ -80,7 +85,7 @@ export const useAddBrainModal = () => {
|
||||
if (createdBrainId === undefined) {
|
||||
publish({
|
||||
variant: "danger",
|
||||
text: t("errorCreatingBrain",{ns:"brain"})
|
||||
text: t("errorCreatingBrain", { ns: "brain" }),
|
||||
});
|
||||
|
||||
return;
|
||||
@ -99,7 +104,7 @@ export const useAddBrainModal = () => {
|
||||
reset(defaultValues);
|
||||
publish({
|
||||
variant: "success",
|
||||
text: t("brainCreated",{ns:"brain"})
|
||||
text: t("brainCreated", { ns: "brain" }),
|
||||
});
|
||||
} catch (err) {
|
||||
if (axios.isAxiosError(err) && err.response?.status === 429) {
|
||||
|
@ -19,7 +19,7 @@ export const Toast = ({
|
||||
children?: ReactNode;
|
||||
} & ToastPrimitive.ToastProviderProps): JSX.Element => {
|
||||
const { publish, toasts, toggleToast } = useToastBuilder();
|
||||
const {t, i18n} = useTranslation();
|
||||
const { t } = useTranslation();
|
||||
|
||||
return (
|
||||
<ToastPrimitive.Provider {...toastProviderProps}>
|
||||
@ -62,7 +62,7 @@ export const Toast = ({
|
||||
);
|
||||
})}
|
||||
</AnimatePresence>
|
||||
<ToastPrimitive.Viewport className="fixed flex-col bottom-0 left-0 right-0 p-5 flex items-end gap-2 outline-none pointer-events-none z-20" />
|
||||
<ToastPrimitive.Viewport className="fixed flex-col bottom-0 left-0 right-0 p-5 flex items-end gap-2 outline-none pointer-events-none z-[99999]" />
|
||||
</ToastContext.Provider>
|
||||
</ToastPrimitive.Provider>
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user