fix: Streams slowing down page loads or not loading at all (#620)
This commit is contained in:
parent
e9b1f17235
commit
b6f0bd356a
12 changed files with 62 additions and 47 deletions
|
@ -1,7 +1,5 @@
|
|||
<script setup lang="ts">
|
||||
const paginator = useMasto().timelines.iteratePublic()
|
||||
const stream = await useMasto().stream.streamPublicTimeline()
|
||||
onBeforeUnmount(() => stream.disconnect())
|
||||
|
||||
|
||||
const { t } = useI18n()
|
||||
|
||||
|
@ -19,8 +17,6 @@ useHeadFixed({
|
|||
</NuxtLink>
|
||||
</template>
|
||||
|
||||
<slot>
|
||||
<TimelinePaginator v-bind="{ paginator, stream }" context="public" />
|
||||
</slot>
|
||||
<TimelinePublic v-if="isMastoInitialised" />
|
||||
</MainContent>
|
||||
</template>
|
||||
|
|
|
@ -1,7 +1,4 @@
|
|||
<script setup lang="ts">
|
||||
const paginator = useMasto().timelines.iteratePublic({ local: true })
|
||||
const stream = await useMasto().stream.streamCommunityTimeline()
|
||||
onBeforeUnmount(() => stream.disconnect())
|
||||
|
||||
const { t } = useI18n()
|
||||
|
||||
|
@ -19,8 +16,6 @@ useHeadFixed({
|
|||
</NuxtLink>
|
||||
</template>
|
||||
|
||||
<slot>
|
||||
<TimelinePaginator v-bind="{ paginator, stream }" context="public" />
|
||||
</slot>
|
||||
<TimelinePublicLocal v-if="isMastoInitialised" />
|
||||
</MainContent>
|
||||
</template>
|
||||
|
|
|
@ -6,8 +6,8 @@ const masto = useMasto()
|
|||
const { data: tag, refresh } = $(await useAsyncData(() => masto.tags.fetch(tagName), { watch: [isMastoInitialised], immediate: isMastoInitialised.value }))
|
||||
|
||||
const paginator = masto.timelines.iterateHashtag(tagName)
|
||||
const stream = await masto.stream.streamTagTimeline(tagName)
|
||||
onBeforeUnmount(() => stream.disconnect())
|
||||
const stream = masto.stream.streamTagTimeline(tagName)
|
||||
onBeforeUnmount(() => stream.then(s => s.disconnect()))
|
||||
|
||||
if (tag) {
|
||||
useHeadFixed({
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue