feat: disable SSR

This commit is contained in:
Anthony Fu 2022-11-23 07:08:36 +08:00
parent e59b3e5db2
commit a6578155ae
29 changed files with 109 additions and 175 deletions

View file

@ -1,10 +1,7 @@
<script setup lang="ts">
const { currentUser } = $(useClientState())
const params = useRoute().params
const id = computed(() => params.post as string)
const masto = await useMasto()
const { data: status } = await useAsyncData(`${id}-status`, () => masto.statuses.fetch(params.post as string))
const { data: context } = await useAsyncData(`${id}-context`, () => masto.statuses.fetchContext(params.post as string))
</script>

View file

@ -5,7 +5,7 @@ const props = defineProps<{
const params = useRoute().params
const user = $computed(() => params.user as string)
const masto = await useMasto()
const { data: account } = await useAsyncData(`${user}:info`, () => masto.accounts.lookup({ acct: user }))
const paginator = masto.accounts.getFollowersIterable(account.value!.id!, {})
</script>

View file

@ -5,7 +5,7 @@ const props = defineProps<{
const params = useRoute().params
const user = $computed(() => params.user as string)
const masto = await useMasto()
const { data: account } = await useAsyncData(`${user}:info`, () => masto.accounts.lookup({ acct: user }))
const paginator = masto.accounts.getFollowingIterable(account.value!.id!, {})
</script>

View file

@ -5,7 +5,7 @@ const props = defineProps<{
const params = useRoute().params
const user = $computed(() => params.user as string)
const masto = await useMasto()
const { data: account } = await useAsyncData(`${user}:info`, () => masto.accounts.lookup({ acct: user }))
const tabNames = ['Posts', 'Posts and replies'] as const

View file

@ -3,7 +3,6 @@ definePageMeta({
middleware: 'auth',
})
const masto = await useMasto()
const paginator = masto.bookmarks.getIterator()
</script>

View file

@ -3,7 +3,6 @@ definePageMeta({
middleware: 'auth',
})
const masto = await useMasto()
const paginator = masto.conversations.getIterator()
</script>

View file

@ -3,7 +3,6 @@ definePageMeta({
middleware: 'auth',
})
const masto = await useMasto()
const paginator = masto.trends.getStatuses()
</script>

View file

@ -3,7 +3,6 @@ definePageMeta({
middleware: 'auth',
})
const masto = await useMasto()
const paginator = masto.favourites.getIterator()
</script>

View file

@ -3,7 +3,6 @@ definePageMeta({
middleware: 'auth',
})
const masto = await useMasto()
const paginator = masto.timelines.getHomeIterable()
</script>

View file

@ -6,8 +6,7 @@ definePageMeta({
const { query } = useRoute()
onMounted(async () => {
const { login } = useClientState()
await login(query as any)
await loginCallback(query as any)
await nextTick()
await nextTick()
location.pathname = '/'

View file

@ -3,8 +3,6 @@ definePageMeta({
middleware: 'auth',
})
const masto = await useMasto()
const tabNames = ['All', 'Mentions'] as const
const tab = $(useLocalStorage<typeof tabNames[number]>('nuxtodon-notifications-tab', 'All'))

View file

@ -1,5 +1,5 @@
<script setup lang="ts">
const masto = await useMasto()
const paginator = masto.timelines.getPublicIterable()
</script>

View file

@ -4,7 +4,7 @@ const router = useRouter()
if (!token.value)
router.replace('/public')
const masto = await useMasto()
const { data: timelines } = await useAsyncData('timelines-home', () => masto.timelines.fetchPublic({ local: true }).then(r => r.value))
</script>

View file

@ -1,7 +1,7 @@
<script setup lang="ts">
const params = useRoute().params
const tag = $computed(() => params.tag as string)
const masto = await useMasto()
const paginator = masto.timelines.getHashtagIterable(tag)
</script>