fix: make isHydrated
export .value
always
This commit is contained in:
parent
9800697670
commit
f1b0befd80
|
@ -22,7 +22,7 @@ defineProps<{
|
||||||
</div>
|
</div>
|
||||||
<div flex items-center flex-shrink-0 gap-x-2>
|
<div flex items-center flex-shrink-0 gap-x-2>
|
||||||
<slot name="actions" />
|
<slot name="actions" />
|
||||||
<NavUser v-if="isHydrated" />
|
<NavUser v-if="isHydrated.value" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<slot name="header" />
|
<slot name="header" />
|
||||||
|
|
|
@ -27,11 +27,11 @@ const description = ref(props.attachment.description ?? '')
|
||||||
v-if="removable"
|
v-if="removable"
|
||||||
aria-label="Remove attachment"
|
aria-label="Remove attachment"
|
||||||
hover:bg="gray/40" transition-100 p-1 rounded-5 cursor-pointer
|
hover:bg="gray/40" transition-100 p-1 rounded-5 cursor-pointer
|
||||||
:class="[isHydrated && isSmallScreen ? '' : 'op-0 group-hover:op-100hover:']"
|
:class="[isHydrated.value && isSmallScreen ? '' : 'op-0 group-hover:op-100hover:']"
|
||||||
mix-blend-difference
|
mix-blend-difference
|
||||||
@click="$emit('remove')"
|
@click="$emit('remove')"
|
||||||
>
|
>
|
||||||
<div i-ri:close-line text-3 :class="[isHydrated && isSmallScreen ? 'text-6' : 'text-3']" />
|
<div i-ri:close-line text-3 :class="[isHydrated.value && isSmallScreen ? 'text-6' : 'text-3']" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div absolute right-2 bottom-2>
|
<div absolute right-2 bottom-2>
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
export const isHydrated = computed(() => {
|
export const isHydrated = computed(() => {
|
||||||
if (process.server)
|
if (process.server)
|
||||||
return false
|
return { value: false }
|
||||||
|
|
||||||
const nuxtApp = useNuxtApp()
|
const nuxtApp = useNuxtApp()
|
||||||
if (!nuxtApp.isHydrating)
|
if (!nuxtApp.isHydrating)
|
||||||
return false
|
return { value: false }
|
||||||
|
|
||||||
const hydrated = ref(false)
|
const hydrated = ref(false)
|
||||||
nuxtApp.hooks.hookOnce('app:suspense:resolve', () => {
|
nuxtApp.hooks.hookOnce('app:suspense:resolve', () => {
|
||||||
|
|
|
@ -44,8 +44,8 @@
|
||||||
<slot />
|
<slot />
|
||||||
</div>
|
</div>
|
||||||
<div sm:hidden sticky left-0 right-0 bottom-0 z-10 bg-base pb="[env(safe-area-inset-bottom)]" transition="padding 20">
|
<div sm:hidden sticky left-0 right-0 bottom-0 z-10 bg-base pb="[env(safe-area-inset-bottom)]" transition="padding 20">
|
||||||
<CommonOfflineChecker :small-screen="isHydrated" />
|
<CommonOfflineChecker :small-screen="isHydrated.value" />
|
||||||
<NavBottom v-if="isHydrated" />
|
<NavBottom v-if="isHydrated.value" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<aside class="hidden sm:none lg:block w-1/4 zen-hide">
|
<aside class="hidden sm:none lg:block w-1/4 zen-hide">
|
||||||
|
|
Loading…
Reference in a new issue