Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
kakkokari-gtyih committed Nov 29, 2024
1 parent 2e88753 commit b98330e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .vitepress/pages/Playground.vue
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ function clearLog() {
type HashData = {
code: string;
};
const hash = ref<string | null>(inBrowser ? null : window.location.hash.slice(1) || localStorage.getItem('ais:playground'));
const hash = ref<string | null>(inBrowser ? window.location.hash.slice(1) || localStorage.getItem('ais:playground') : null);
const hashData = computed<HashData | null>(() => {
if (hash.value == null) return null;
try {
Expand Down
8 changes: 5 additions & 3 deletions .vitepress/theme/Layout.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<template>
<DefaultTheme.Layout />
<div v-if="!loaded" :class="$style.w"></div>
<div>
<DefaultTheme.Layout />
<div v-if="!loaded" :class="$style.w"></div>
</div>
</template>

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

0 comments on commit b98330e

Please sign in to comment.