chore: cleanup isHydrated (#2614)

Co-authored-by: patak <583075+patak-dev@users.noreply.github.com>
zio/stable
Joaquín Sánchez 2024-02-24 19:24:19 +01:00 committed by GitHub
parent 6b40319723
commit eddbb1eee9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 14 additions and 14 deletions

View File

@ -88,23 +88,23 @@ function deletePollOption(index: number) {
const expiresInOptions = computed(() => [ const expiresInOptions = computed(() => [
{ {
seconds: 1 * 60 * 60, seconds: 1 * 60 * 60,
label: isHydrated.value ? t('time_ago_options.hour_future', 1) : '', label: t('time_ago_options.hour_future', 1),
}, },
{ {
seconds: 2 * 60 * 60, seconds: 2 * 60 * 60,
label: isHydrated.value ? t('time_ago_options.hour_future', 2) : '', label: t('time_ago_options.hour_future', 2),
}, },
{ {
seconds: 1 * 24 * 60 * 60, seconds: 1 * 24 * 60 * 60,
label: isHydrated.value ? t('time_ago_options.day_future', 1) : '', label: t('time_ago_options.day_future', 1),
}, },
{ {
seconds: 2 * 24 * 60 * 60, seconds: 2 * 24 * 60 * 60,
label: isHydrated.value ? t('time_ago_options.day_future', 2) : '', label: t('time_ago_options.day_future', 2),
}, },
{ {
seconds: 7 * 24 * 60 * 60, seconds: 7 * 24 * 60 * 60,
label: isHydrated.value ? t('time_ago_options.day_future', 7) : '', label: t('time_ago_options.day_future', 7),
}, },
]) ])

View File

@ -77,7 +77,7 @@ function activate() {
ps-3 ps-3
pe-1 pe-1
ml-1 ml-1
:placeholder="isHydrated ? t('nav.search') : ''" :placeholder="t('nav.search')"
pb="1px" pb="1px"
placeholder-text-secondary placeholder-text-secondary
@keydown.down.prevent="shift(1)" @keydown.down.prevent="shift(1)"

View File

@ -19,21 +19,21 @@ const userSettings = useUserSettings()
const tabs = computed<CommonRouteTabOption[]>(() => [ const tabs = computed<CommonRouteTabOption[]>(() => [
{ {
to: isHydrated.value ? `/${currentServer.value}/explore` : '/explore', to: isHydrated.value ? `/${currentServer.value}/explore` : '/explore',
display: isHydrated.value ? t('tab.posts') : '', display: t('tab.posts'),
}, },
{ {
to: isHydrated.value ? `/${currentServer.value}/explore/tags` : '/explore/tags', to: isHydrated.value ? `/${currentServer.value}/explore/tags` : '/explore/tags',
display: isHydrated.value ? t('tab.hashtags') : '', display: t('tab.hashtags'),
}, },
{ {
to: isHydrated.value ? `/${currentServer.value}/explore/links` : '/explore/links', to: isHydrated.value ? `/${currentServer.value}/explore/links` : '/explore/links',
display: isHydrated.value ? t('tab.news') : '', display: t('tab.news'),
hide: userSettings.value.preferences.hideNews, hide: userSettings.value.preferences.hideNews,
}, },
// This section can only be accessed after logging in // This section can only be accessed after logging in
{ {
to: isHydrated.value ? `/${currentServer.value}/explore/users` : '/explore/users', to: isHydrated.value ? `/${currentServer.value}/explore/users` : '/explore/users',
display: isHydrated.value ? t('tab.for_you') : '', display: t('tab.for_you'),
disabled: !isHydrated.value || !currentUser.value, disabled: !isHydrated.value || !currentUser.value,
}, },
]) ])

View File

@ -2,7 +2,7 @@
<div min-h-screen flex justify-center items-center> <div min-h-screen flex justify-center items-center>
<div text-center flex="~ col gap-2" items-center> <div text-center flex="~ col gap-2" items-center>
<div i-ri:settings-3-line text-5xl /> <div i-ri:settings-3-line text-5xl />
<span text-xl>{{ isHydrated ? $t('settings.select_a_settings') : '' }}</span> <span text-xl>{{ $t('settings.select_a_settings') }}</span>
</div> </div>
</div> </div>
</template> </template>

View File

@ -15,16 +15,16 @@ useHydratedHead({
<template #title> <template #title>
<div text-lg font-bold flex items-center gap-2 @click="$scrollToTop"> <div text-lg font-bold flex items-center gap-2 @click="$scrollToTop">
<div i-ri:test-tube-line /> <div i-ri:test-tube-line />
<span>{{ isHydrated ? $t('settings.notifications.notifications.label') : '' }}</span> <span>{{ $t('settings.notifications.notifications.label') }}</span>
</div> </div>
</template> </template>
<div text-center mt-10> <div text-center mt-10>
<h1 text-4xl> <h1 text-4xl>
<span sr-only>{{ isHydrated ? $t('settings.notifications.under_construction') : '' }}</span> <span sr-only>{{ $t('settings.notifications.under_construction') }}</span>
🚧 🚧
</h1> </h1>
<h3 text-xl> <h3 text-xl>
{{ isHydrated ? $t('settings.notifications.notifications.label') : '' }} {{ $t('settings.notifications.notifications.label') }}
</h3> </h3>
</div> </div>
</MainContent> </MainContent>