This commit is contained in:
+4
-4
@@ -6,7 +6,7 @@ import {
|
||||
type ToastPosition,
|
||||
} from "react-hot-toast";
|
||||
|
||||
import { resolveLocale } from "@/lib/locale";
|
||||
import { FALLBACK_LOCALE, resolveLocale } from "@/lib/locale";
|
||||
|
||||
type ToastVariant = "default" | "success" | "error" | "loading";
|
||||
|
||||
@@ -14,13 +14,13 @@ type ToastMessage = string;
|
||||
|
||||
function getCurrentLocale() {
|
||||
if (typeof window === "undefined") {
|
||||
return "de" as const;
|
||||
return FALLBACK_LOCALE;
|
||||
}
|
||||
|
||||
const pathname = window.location.pathname;
|
||||
const maybeLocale = pathname.split("/")[1] || "de";
|
||||
const maybeLocale = pathname.split("/")[1] || FALLBACK_LOCALE;
|
||||
|
||||
return resolveLocale(maybeLocale);
|
||||
return resolveLocale(maybeLocale, FALLBACK_LOCALE);
|
||||
}
|
||||
|
||||
function getToastPosition(isArabic: boolean): ToastPosition {
|
||||
|
||||
Reference in New Issue
Block a user