mirror of
https://github.com/cupcakearmy/svelte-i18n.git
synced 2024-11-16 09:59:58 +01: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
|
||||
// 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)
|
||||
} else {
|
||||
$isLoading.set(true)
|
||||
|
Loading…
Reference in New Issue
Block a user