Skip to content

Commit b98330e

Browse files
committedNov 29, 2024·
fix
1 parent 2e88753 commit b98330e

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed
 

‎.vitepress/pages/Playground.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ function clearLog() {
272272
type HashData = {
273273
code: string;
274274
};
275-
const hash = ref<string | null>(inBrowser ? null : window.location.hash.slice(1) || localStorage.getItem('ais:playground'));
275+
const hash = ref<string | null>(inBrowser ? window.location.hash.slice(1) || localStorage.getItem('ais:playground') : null);
276276
const hashData = computed<HashData | null>(() => {
277277
if (hash.value == null) return null;
278278
try {

‎.vitepress/theme/Layout.vue

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
<template>
2-
<DefaultTheme.Layout />
3-
<div v-if="!loaded" :class="$style.w"></div>
2+
<div>
3+
<DefaultTheme.Layout />
4+
<div v-if="!loaded" :class="$style.w"></div>
5+
</div>
46
</template>
57

68
<script setup lang="ts">
@@ -14,7 +16,7 @@ const loaded = ref(false);
1416
1517
const locales = Object.keys(data.site.value.locales) as string[];
1618
const localesRegex = new RegExp(`^/(${locales.join('|')})`);
17-
const savedLocale = localStorage.getItem('ais:locale');
19+
const savedLocale = inBrowser ? localStorage.getItem('ais:locale') : null;
1820
1921
if (inBrowser) {
2022
if (!localesRegex.test(route.path)) {

0 commit comments

Comments
 (0)
Please sign in to comment.