diff --git a/app/components/timeline/TimelineNotifications.vue b/app/components/timeline/TimelineNotifications.vue index b966b7d4..e64d2702 100644 --- a/app/components/timeline/TimelineNotifications.vue +++ b/app/components/timeline/TimelineNotifications.vue @@ -13,7 +13,7 @@ const options = { limit: 30, types: filter ? [filter] : [] } // Default limit is 20 notifications, and servers are normally caped to 30 const paginator = useMastoClient().v1.notifications.list(options) -const stream = useStreaming(client => client.user.notification.subscribe()) +const stream = useStreaming(client => client.user.subscribe()) lastAccessedNotificationRoute.value = route.path.replace(/\/notifications\/?/, '') diff --git a/app/composables/masto/notification.ts b/app/composables/masto/notification.ts index 20939bec..fb62bf11 100644 --- a/app/composables/masto/notification.ts +++ b/app/composables/masto/notification.ts @@ -44,7 +44,7 @@ export function useNotifications() { processNotifications(stream, id) const position = await client.value.v1.markers.fetch({ timeline: ['notifications'] }) - const paginator = client.value.v1.notifications.list({ limit: 30 }) + const paginator = client.value.v1.notifications.list({ limit: 30 }).values() do { const result = await paginator.next() diff --git a/app/composables/paginator.ts b/app/composables/paginator.ts index 93aeed1f..e7f47724 100644 --- a/app/composables/paginator.ts +++ b/app/composables/paginator.ts @@ -12,7 +12,7 @@ export function usePaginator( // called `next` method will mutate the internal state of the variable, // and we need its initial state after HMR // so clone it - const paginator = _paginator.clone() + const paginator = _paginator.values() const state = ref(isHydrated.value ? 'idle' : 'loading') const items = ref([]) diff --git a/app/composables/tiptap/suggestion.ts b/app/composables/tiptap/suggestion.ts index fdaa24cd..3b4b0b16 100644 --- a/app/composables/tiptap/suggestion.ts +++ b/app/composables/tiptap/suggestion.ts @@ -14,6 +14,7 @@ import { currentCustomEmojis, updateCustomEmojis } from '~/composables/emojis' export type { Emoji } export type CustomEmoji = (mastodon.v1.CustomEmoji & { custom: true }) + export function isCustomEmoji(emoji: CustomEmoji | Emoji): emoji is CustomEmoji { return !!(emoji as CustomEmoji).custom } @@ -27,7 +28,12 @@ export const TiptapMentionSuggestion: Partial = import.meta.s if (query.length === 0) return [] - const paginator = useMastoClient().v2.search.list({ q: query, type: 'accounts', limit: 25, resolve: true }) + const paginator = useMastoClient().v2.search.list({ + q: query, + type: 'accounts', + limit: 25, + resolve: true, + }).values() return (await paginator.next()).value?.accounts ?? [] }, render: createSuggestionRenderer(TiptapMentionList), @@ -46,7 +52,7 @@ export const TiptapHashtagSuggestion: Partial = { limit: 25, resolve: false, excludeUnreviewed: true, - }) + }).values() return (await paginator.next()).value?.hashtags ?? [] }, render: createSuggestionRenderer(TiptapHashtagList), diff --git a/app/middleware/1.permalink.global.ts b/app/middleware/1.permalink.global.ts index 754d0815..c61e1a97 100644 --- a/app/middleware/1.permalink.global.ts +++ b/app/middleware/1.permalink.global.ts @@ -43,7 +43,7 @@ export default defineNuxtRouteMiddleware(async (to, from) => { } // If we're logged in, search for the local id the account or status corresponds to - const paginator = masto.client.value.v2.search.list({ q: `https:/${to.fullPath}`, resolve: true, limit: 1 }) + const paginator = masto.client.value.v2.search.list({ q: `https:/${to.fullPath}`, resolve: true, limit: 1 }).values() const { accounts, statuses } = (await paginator.next()).value ?? { accounts: [], statuses: [] } if (statuses[0])