Skip to content

Commit

Permalink
fix: πŸ› only set lang attr if lang is not nullish
Browse files Browse the repository at this point in the history
βœ… Closes: #133
  • Loading branch information
kaisermann committed Mar 27, 2021
1 parent cb443f8 commit 1c516c9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/runtime/stores/locale.ts
Expand Up @@ -35,7 +35,7 @@ export function getCurrentLocale() {
$locale.subscribe((newLocale: string) => {
current = newLocale;

if (typeof window !== 'undefined') {
if (typeof window !== 'undefined' && newLocale !== null) {
document.documentElement.setAttribute('lang', newLocale);
}
});
Expand Down

0 comments on commit 1c516c9

Please sign in to comment.