feat: re-apply timelines loading optimization (#524)
Co-authored-by: Daniel Roe <daniel@roe.dev>
This commit is contained in:
parent
db7f82422e
commit
baa2696d31
5
app.vue
5
app.vue
|
@ -6,12 +6,15 @@ provideGlobalCommands()
|
||||||
|
|
||||||
// We want to trigger rerendering the page when account changes
|
// We want to trigger rerendering the page when account changes
|
||||||
const key = computed(() => `${currentUser.value?.server ?? currentServer.value}:${currentUser.value?.account.id || ''}`)
|
const key = computed(() => `${currentUser.value?.server ?? currentServer.value}:${currentUser.value?.account.id || ''}`)
|
||||||
|
|
||||||
|
const { params } = useRoute()
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<NuxtLoadingIndicator color="repeating-linear-gradient(to right,var(--c-primary) 0%,var(--c-primary-active) 100%)" />
|
<NuxtLoadingIndicator color="repeating-linear-gradient(to right,var(--c-primary) 0%,var(--c-primary-active) 100%)" />
|
||||||
<NuxtLayout :key="key">
|
<NuxtLayout :key="key">
|
||||||
<NuxtPage v-if="isMastoInitialised" />
|
<!-- TODO: rework the /[account] routes to remove conditional loading -->
|
||||||
|
<NuxtPage v-if="(!params.account && $route.path !== '/signin/callback') || isMastoInitialised" />
|
||||||
</NuxtLayout>
|
</NuxtLayout>
|
||||||
<AriaAnnouncer />
|
<AriaAnnouncer />
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -5,6 +5,7 @@ const { options, command, replace, preventScrollTop = false } = $defineProps<{
|
||||||
options: {
|
options: {
|
||||||
to: RouteLocationRaw
|
to: RouteLocationRaw
|
||||||
display: string
|
display: string
|
||||||
|
disabled?: boolean
|
||||||
name?: string
|
name?: string
|
||||||
icon?: string
|
icon?: string
|
||||||
}[]
|
}[]
|
||||||
|
@ -28,18 +29,25 @@ useCommands(() => command
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div flex w-full items-center lg:text-lg of-x-auto scrollbar-hide>
|
<div flex w-full items-center lg:text-lg of-x-auto scrollbar-hide>
|
||||||
<NuxtLink
|
<template
|
||||||
v-for="(option, index) in options"
|
v-for="(option, index) in options"
|
||||||
:key="option?.name || index"
|
:key="option?.name || index"
|
||||||
|
>
|
||||||
|
<NuxtLink
|
||||||
|
v-if="!option.disabled"
|
||||||
:to="option.to"
|
:to="option.to"
|
||||||
:replace="replace"
|
:replace="replace"
|
||||||
relative flex flex-auto cursor-pointer sm:px6 px2 rounded transition-all
|
relative flex flex-auto cursor-pointer sm:px6 px2 rounded transition-all
|
||||||
tabindex="1"
|
tabindex="1"
|
||||||
hover:bg-active transition-100
|
hover:bg-active transition-100
|
||||||
exact-active-class="children:(font-bold !border-primary !op100)"
|
exact-active-class="children:(text-secondary !border-primary !op100)"
|
||||||
@click="!preventScrollTop && $scrollToTop()"
|
@click="!preventScrollTop && $scrollToTop()"
|
||||||
>
|
>
|
||||||
<span ws-nowrap mxa sm:px2 sm:py3 py2 text-center border-b-3 op50 hover:op70 border-transparent>{{ option.display }}</span>
|
<span ws-nowrap mxa sm:px2 sm:py3 py2 text-center border-b-3 text-secondary-light hover:text-secondary border-transparent>{{ option.display }}</span>
|
||||||
</NuxtLink>
|
</NuxtLink>
|
||||||
|
<div v-else flex flex-auto sm:px6 px2>
|
||||||
|
<span ws-nowrap mxa sm:px2 sm:py3 py2 text-center text-secondary-light op50>{{ option.display }}</span>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
7
components/timeline/TimelineBlocks.vue
Normal file
7
components/timeline/TimelineBlocks.vue
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
<script setup lang="ts">
|
||||||
|
const paginator = useMasto().blocks.iterate()
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<AccountPaginator :paginator="paginator" />
|
||||||
|
</template>
|
7
components/timeline/TimelineBookmarks.vue
Normal file
7
components/timeline/TimelineBookmarks.vue
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
<script setup lang="ts">
|
||||||
|
const paginator = useMasto().bookmarks.iterate()
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<TimelinePaginator :paginator="paginator" />
|
||||||
|
</template>
|
7
components/timeline/TimelineConversations.vue
Normal file
7
components/timeline/TimelineConversations.vue
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
<script setup lang="ts">
|
||||||
|
const paginator = useMasto().conversations.iterate()
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<ConversationPaginator :paginator="paginator" />
|
||||||
|
</template>
|
21
components/timeline/TimelineDomainBlocks.vue
Normal file
21
components/timeline/TimelineDomainBlocks.vue
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
<script setup lang="ts">
|
||||||
|
const masto = useMasto()
|
||||||
|
const paginator = masto.domainBlocks.iterate()
|
||||||
|
|
||||||
|
const unblock = async (domain: string) => {
|
||||||
|
await masto.domainBlocks.unblock(domain)
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<CommonPaginator :paginator="paginator">
|
||||||
|
<template #default="{ item }">
|
||||||
|
<CommonDropdownItem class="!cursor-auto">
|
||||||
|
{{ item }}
|
||||||
|
<template #actions>
|
||||||
|
<div i-ri:lock-unlock-line text-primary cursor-pointer @click="unblock(item)" />
|
||||||
|
</template>
|
||||||
|
</CommonDropdownItem>
|
||||||
|
</template>
|
||||||
|
</CommonPaginator>
|
||||||
|
</template>
|
7
components/timeline/TimelineFavourites.vue
Normal file
7
components/timeline/TimelineFavourites.vue
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
<script setup lang="ts">
|
||||||
|
const paginator = useMasto().favourites.iterate()
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<TimelinePaginator :paginator="paginator" />
|
||||||
|
</template>
|
12
components/timeline/TimelineHome.vue
Normal file
12
components/timeline/TimelineHome.vue
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
<script setup lang="ts">
|
||||||
|
const paginator = useMasto().timelines.iterateHome()
|
||||||
|
const stream = await useMasto().stream.streamUser()
|
||||||
|
onBeforeUnmount(() => stream.disconnect())
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<PublishWidget draft-key="home" border="b base" />
|
||||||
|
<TimelinePaginator v-bind="{ paginator, stream }" context="home" />
|
||||||
|
</div>
|
||||||
|
</template>
|
13
components/timeline/TimelineMentions.vue
Normal file
13
components/timeline/TimelineMentions.vue
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
<script setup lang="ts">
|
||||||
|
// Default limit is 20 notifications, and servers are normally caped to 30
|
||||||
|
const paginator = useMasto().notifications.iterate({ limit: 30, types: ['mention'] })
|
||||||
|
|
||||||
|
const { clearNotifications } = useNotifications()
|
||||||
|
onActivated(clearNotifications)
|
||||||
|
|
||||||
|
const stream = await useMasto().stream.streamUser()
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<NotificationPaginator v-bind="{ paginator, stream }" />
|
||||||
|
</template>
|
7
components/timeline/TimelineMutes.vue
Normal file
7
components/timeline/TimelineMutes.vue
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
<script setup lang="ts">
|
||||||
|
const paginator = useMasto().mutes.iterate()
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<AccountPaginator :paginator="paginator" />
|
||||||
|
</template>
|
13
components/timeline/TimelineNotifications.vue
Normal file
13
components/timeline/TimelineNotifications.vue
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
<script setup lang="ts">
|
||||||
|
// Default limit is 20 notifications, and servers are normally caped to 30
|
||||||
|
const paginator = useMasto().notifications.iterate({ limit: 30 })
|
||||||
|
|
||||||
|
const { clearNotifications } = useNotifications()
|
||||||
|
onActivated(clearNotifications)
|
||||||
|
|
||||||
|
const stream = await useMasto().stream.streamUser()
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<NotificationPaginator v-bind="{ paginator, stream }" />
|
||||||
|
</template>
|
7
components/timeline/TimelinePinned.vue
Normal file
7
components/timeline/TimelinePinned.vue
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
<script setup lang="ts">
|
||||||
|
const paginator = useMasto().accounts.iterateStatuses(currentUser.value!.account.id, { pinned: true })
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<TimelinePaginator :paginator="paginator" />
|
||||||
|
</template>
|
|
@ -17,15 +17,11 @@ const tabs = $computed(() => [
|
||||||
display: t('tab.news'),
|
display: t('tab.news'),
|
||||||
},
|
},
|
||||||
// This section can only be accessed after logging in
|
// This section can only be accessed after logging in
|
||||||
...invoke(() => currentUser.value
|
|
||||||
? [
|
|
||||||
{
|
{
|
||||||
to: `/${currentServer.value}/explore/users`,
|
to: `/${currentServer.value}/explore/users`,
|
||||||
display: t('tab.for_you'),
|
display: t('tab.for_you'),
|
||||||
|
disabled: !isMastoInitialised.value || !currentUser.value,
|
||||||
},
|
},
|
||||||
]
|
|
||||||
: [],
|
|
||||||
),
|
|
||||||
] as const)
|
] as const)
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
@ -41,6 +37,6 @@ const tabs = $computed(() => [
|
||||||
<template #header>
|
<template #header>
|
||||||
<CommonRouteTabs replace :options="tabs" />
|
<CommonRouteTabs replace :options="tabs" />
|
||||||
</template>
|
</template>
|
||||||
<NuxtPage />
|
<NuxtPage v-if="isMastoInitialised" />
|
||||||
</MainContent>
|
</MainContent>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -3,8 +3,6 @@ definePageMeta({
|
||||||
middleware: 'auth',
|
middleware: 'auth',
|
||||||
})
|
})
|
||||||
|
|
||||||
const paginator = useMasto().blocks.iterate()
|
|
||||||
|
|
||||||
useHeadFixed({
|
useHeadFixed({
|
||||||
title: 'Blocked users',
|
title: 'Blocked users',
|
||||||
})
|
})
|
||||||
|
@ -15,6 +13,7 @@ useHeadFixed({
|
||||||
<template #title>
|
<template #title>
|
||||||
<span text-lg font-bold>{{ $t('account.blocked_users') }}</span>
|
<span text-lg font-bold>{{ $t('account.blocked_users') }}</span>
|
||||||
</template>
|
</template>
|
||||||
<AccountPaginator :paginator="paginator" />
|
|
||||||
|
<TimelineBlocks v-if="isMastoInitialised" />
|
||||||
</MainContent>
|
</MainContent>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -3,8 +3,6 @@ definePageMeta({
|
||||||
middleware: 'auth',
|
middleware: 'auth',
|
||||||
})
|
})
|
||||||
|
|
||||||
const paginator = useMasto().bookmarks.iterate()
|
|
||||||
|
|
||||||
const { t } = useI18n()
|
const { t } = useI18n()
|
||||||
|
|
||||||
useHeadFixed({
|
useHeadFixed({
|
||||||
|
@ -21,8 +19,6 @@ useHeadFixed({
|
||||||
</NuxtLink>
|
</NuxtLink>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<slot>
|
<TimelineBookmarks v-if="isMastoInitialised" />
|
||||||
<TimelinePaginator :paginator="paginator" />
|
|
||||||
</slot>
|
|
||||||
</MainContent>
|
</MainContent>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -3,8 +3,6 @@ definePageMeta({
|
||||||
middleware: 'auth',
|
middleware: 'auth',
|
||||||
})
|
})
|
||||||
|
|
||||||
const paginator = useMasto().conversations.iterate()
|
|
||||||
|
|
||||||
const { t } = useI18n()
|
const { t } = useI18n()
|
||||||
|
|
||||||
useHeadFixed({
|
useHeadFixed({
|
||||||
|
@ -21,8 +19,6 @@ useHeadFixed({
|
||||||
</NuxtLink>
|
</NuxtLink>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<slot>
|
<TimelineConversations v-if="isMastoInitialised" />
|
||||||
<ConversationPaginator :paginator="paginator" />
|
|
||||||
</slot>
|
|
||||||
</MainContent>
|
</MainContent>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -1,18 +1,13 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
import TimelineDomainBlocks from '~~/components/timeline/TimelineDomainBlocks.vue'
|
||||||
|
|
||||||
definePageMeta({
|
definePageMeta({
|
||||||
middleware: 'auth',
|
middleware: 'auth',
|
||||||
})
|
})
|
||||||
|
|
||||||
const masto = useMasto()
|
|
||||||
const paginator = masto.domainBlocks.iterate()
|
|
||||||
|
|
||||||
useHeadFixed({
|
useHeadFixed({
|
||||||
title: 'Blocked domains',
|
title: 'Blocked domains',
|
||||||
})
|
})
|
||||||
|
|
||||||
const unblock = async (domain: string) => {
|
|
||||||
await masto.domainBlocks.unblock(domain)
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
@ -21,15 +16,6 @@ const unblock = async (domain: string) => {
|
||||||
<span text-lg font-bold>{{ $t('account.blocked_domains') }}</span>
|
<span text-lg font-bold>{{ $t('account.blocked_domains') }}</span>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<CommonPaginator :paginator="paginator">
|
<TimelineDomainBlocks v-if="isMastoInitialised" />
|
||||||
<template #default="{ item }">
|
|
||||||
<CommonDropdownItem class="!cursor-auto">
|
|
||||||
{{ item }}
|
|
||||||
<template #actions>
|
|
||||||
<div i-ri:lock-unlock-line text-primary cursor-pointer @click="unblock(item)" />
|
|
||||||
</template>
|
|
||||||
</CommonDropdownItem>
|
|
||||||
</template>
|
|
||||||
</CommonPaginator>
|
|
||||||
</MainContent>
|
</MainContent>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -3,7 +3,6 @@ definePageMeta({
|
||||||
middleware: 'auth',
|
middleware: 'auth',
|
||||||
})
|
})
|
||||||
|
|
||||||
const paginator = useMasto().favourites.iterate()
|
|
||||||
const { t } = useI18n()
|
const { t } = useI18n()
|
||||||
|
|
||||||
useHeadFixed({
|
useHeadFixed({
|
||||||
|
@ -19,8 +18,7 @@ useHeadFixed({
|
||||||
<span>{{ t('nav_side.favourites') }}</span>
|
<span>{{ t('nav_side.favourites') }}</span>
|
||||||
</NuxtLink>
|
</NuxtLink>
|
||||||
</template>
|
</template>
|
||||||
<slot>
|
|
||||||
<TimelinePaginator :paginator="paginator" />
|
<TimelineFavourites v-if="isMastoInitialised" />
|
||||||
</slot>
|
|
||||||
</MainContent>
|
</MainContent>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -6,16 +6,6 @@ definePageMeta({
|
||||||
alias: ['/signin/callback'],
|
alias: ['/signin/callback'],
|
||||||
})
|
})
|
||||||
|
|
||||||
if (useRoute().path === '/signin/callback') {
|
|
||||||
// This only cleans up the URL; page content should stay the same
|
|
||||||
useRouter().push('/home')
|
|
||||||
}
|
|
||||||
|
|
||||||
const masto = useMasto()
|
|
||||||
const paginator = masto.timelines.iterateHome()
|
|
||||||
const stream = await masto.stream.streamUser()
|
|
||||||
onBeforeUnmount(() => stream.disconnect())
|
|
||||||
|
|
||||||
const { t } = useI18n()
|
const { t } = useI18n()
|
||||||
useHeadFixed({
|
useHeadFixed({
|
||||||
title: () => t('nav_side.home'),
|
title: () => t('nav_side.home'),
|
||||||
|
@ -30,9 +20,7 @@ useHeadFixed({
|
||||||
<span>{{ $t('nav_side.home') }}</span>
|
<span>{{ $t('nav_side.home') }}</span>
|
||||||
</NuxtLink>
|
</NuxtLink>
|
||||||
</template>
|
</template>
|
||||||
<slot>
|
|
||||||
<PublishWidget draft-key="home" border="b base" />
|
<TimelineHome v-if="isMastoInitialised" />
|
||||||
<TimelinePaginator v-bind="{ paginator, stream }" context="home" />
|
|
||||||
</slot>
|
|
||||||
</MainContent>
|
</MainContent>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -2,9 +2,6 @@
|
||||||
definePageMeta({
|
definePageMeta({
|
||||||
middleware: 'auth',
|
middleware: 'auth',
|
||||||
})
|
})
|
||||||
|
|
||||||
const paginator = useMasto().mutes.iterate()
|
|
||||||
|
|
||||||
useHeadFixed({
|
useHeadFixed({
|
||||||
title: 'Muted users',
|
title: 'Muted users',
|
||||||
})
|
})
|
||||||
|
@ -15,6 +12,7 @@ useHeadFixed({
|
||||||
<template #title>
|
<template #title>
|
||||||
<span text-lg font-bold>{{ $t('account.muted_users') }}</span>
|
<span text-lg font-bold>{{ $t('account.muted_users') }}</span>
|
||||||
</template>
|
</template>
|
||||||
<AccountPaginator :paginator="paginator" />
|
|
||||||
|
<TimelineMutes v-if="isMastoInitialised" />
|
||||||
</MainContent>
|
</MainContent>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -53,6 +53,7 @@ onActivated(() => {
|
||||||
<template v-if="pwaEnabled">
|
<template v-if="pwaEnabled">
|
||||||
<NotificationPreferences :show="showSettings" />
|
<NotificationPreferences :show="showSettings" />
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<NuxtPage />
|
<NuxtPage />
|
||||||
</slot>
|
</slot>
|
||||||
</MainContent>
|
</MainContent>
|
||||||
|
|
|
@ -1,20 +1,10 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
const { t } = useI18n()
|
const { t } = useI18n()
|
||||||
const masto = useMasto()
|
|
||||||
|
|
||||||
// Default limit is 20 notifications, and servers are normally caped to 30
|
|
||||||
const paginator = masto.notifications.iterate({ limit: 30 })
|
|
||||||
|
|
||||||
const { clearNotifications } = useNotifications()
|
|
||||||
onActivated(clearNotifications)
|
|
||||||
|
|
||||||
const stream = await masto.stream.streamUser()
|
|
||||||
|
|
||||||
useHeadFixed({
|
useHeadFixed({
|
||||||
title: () => `${t('tab.notifications_all')} | ${t('nav_side.notifications')}`,
|
title: () => `${t('tab.notifications_all')} | ${t('nav_side.notifications')}`,
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<NotificationPaginator v-bind="{ paginator, stream }" />
|
<TimelineNotifications v-if="isMastoInitialised" />
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -1,20 +1,10 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
const { t } = useI18n()
|
const { t } = useI18n()
|
||||||
|
|
||||||
const masto = useMasto()
|
|
||||||
// Default limit is 20 notifications, and servers are normally caped to 30
|
|
||||||
const paginator = masto.notifications.iterate({ limit: 30, types: ['mention'] })
|
|
||||||
|
|
||||||
const { clearNotifications } = useNotifications()
|
|
||||||
onActivated(clearNotifications)
|
|
||||||
|
|
||||||
const stream = await masto.stream.streamUser()
|
|
||||||
|
|
||||||
useHeadFixed({
|
useHeadFixed({
|
||||||
title: () => `${t('tab.notifications_mention')} | ${t('nav_side.notifications')}`,
|
title: () => `${t('tab.notifications_mention')} | ${t('nav_side.notifications')}`,
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<NotificationPaginator v-bind="{ paginator, stream }" />
|
<TimelineNotifications v-if="isMastoInitialised" />
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -18,6 +18,6 @@ useHeadFixed({
|
||||||
<span>{{ t('account.pinned') }}</span>
|
<span>{{ t('account.pinned') }}</span>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<TimelinePaginator :paginator="paginator" />
|
<TimelinePinned v-if="isMastoInitialised" />
|
||||||
</MainContent>
|
</MainContent>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -2,7 +2,8 @@ export default defineNuxtPlugin(async (nuxtApp) => {
|
||||||
const masto = createMasto()
|
const masto = createMasto()
|
||||||
|
|
||||||
if (process.client) {
|
if (process.client) {
|
||||||
const { query } = useRoute()
|
const { query, path } = useRoute()
|
||||||
|
const router = useRouter()
|
||||||
const user = typeof query.server === 'string' && typeof query.token === 'string'
|
const user = typeof query.server === 'string' && typeof query.token === 'string'
|
||||||
? {
|
? {
|
||||||
server: query.server,
|
server: query.server,
|
||||||
|
@ -13,8 +14,13 @@ export default defineNuxtPlugin(async (nuxtApp) => {
|
||||||
|
|
||||||
nuxtApp.hook('app:suspense:resolve', () => {
|
nuxtApp.hook('app:suspense:resolve', () => {
|
||||||
// TODO: improve upstream to make this synchronous (delayed auth)
|
// TODO: improve upstream to make this synchronous (delayed auth)
|
||||||
if (!masto.loggedIn.value)
|
if (!masto.loggedIn.value) {
|
||||||
masto.loginTo(user)
|
masto.loginTo(user).then(() => {
|
||||||
|
// This only cleans up the URL; page content should stay the same
|
||||||
|
if (path === '/signin/callback')
|
||||||
|
router.push('/home')
|
||||||
|
})
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue