mirror of
https://github.com/cupcakearmy/svelte-i18n.git
synced 2024-09-28 15:14:45 +02:00
parent
2a1bea5559
commit
07ef1da6d5
@ -66,7 +66,11 @@ $locale.set = (newLocale: string): void | Promise<void> => {
|
|||||||
|
|
||||||
// if there's no current locale, we don't wait to set isLoading to true
|
// if there's no current locale, we don't wait to set isLoading to true
|
||||||
// because it would break pages when loading the initial locale
|
// because it would break pages when loading the initial locale
|
||||||
if (getCurrentLocale() != null && loadingDelay) {
|
if (
|
||||||
|
typeof window !== 'undefined' &&
|
||||||
|
getCurrentLocale() != null &&
|
||||||
|
loadingDelay
|
||||||
|
) {
|
||||||
loadingTimer = window.setTimeout(() => $isLoading.set(true), loadingDelay)
|
loadingTimer = window.setTimeout(() => $isLoading.set(true), loadingDelay)
|
||||||
} else {
|
} else {
|
||||||
$isLoading.set(true)
|
$isLoading.set(true)
|
||||||
|
Loading…
Reference in New Issue
Block a user