diff --git a/components/account/AccountFollowButton.vue b/components/account/AccountFollowButton.vue index 255d455d..f1ef9f0b 100644 --- a/components/account/AccountFollowButton.vue +++ b/components/account/AccountFollowButton.vue @@ -12,11 +12,11 @@ const isSelf = $(useSelfAccount(() => account)) const enable = $computed(() => !isSelf && currentUser.value) const relationship = $computed(() => props.relationship || useRelationship(account).value) -const masto = useMasto() +const { client } = $(useMasto()) async function toggleFollow() { relationship!.following = !relationship!.following try { - const newRel = await masto.v1.accounts[relationship!.following ? 'follow' : 'unfollow'](account.id) + const newRel = await client.v1.accounts[relationship!.following ? 'follow' : 'unfollow'](account.id) Object.assign(relationship!, newRel) } catch (err) { @@ -29,7 +29,7 @@ async function toggleFollow() { async function unblock() { relationship!.blocking = false try { - const newRel = await masto.v1.accounts.unblock(account.id) + const newRel = await client.v1.accounts.unblock(account.id) Object.assign(relationship!, newRel) } catch (err) { @@ -42,7 +42,7 @@ async function unblock() { async function unmute() { relationship!.muting = false try { - const newRel = await masto.v1.accounts.unmute(account.id) + const newRel = await client.v1.accounts.unmute(account.id) Object.assign(relationship!, newRel) } catch (err) { diff --git a/components/account/AccountHeader.vue b/components/account/AccountHeader.vue index 8de0605c..8b307989 100644 --- a/components/account/AccountHeader.vue +++ b/components/account/AccountHeader.vue @@ -6,7 +6,7 @@ const { account } = defineProps<{ command?: boolean }>() -const masto = useMasto() +const { client } = $(useMasto()) const { t } = useI18n() @@ -46,7 +46,7 @@ function previewAvatar() { async function toggleNotify() { relationship!.notifying = !relationship!.notifying try { - const newRel = await masto.v1.accounts.follow(account.id, { notify: relationship!.notifying }) + const newRel = await client.v1.accounts.follow(account.id, { notify: relationship!.notifying }) Object.assign(relationship!, newRel) } catch { diff --git a/components/account/AccountMoreButton.vue b/components/account/AccountMoreButton.vue index 70c99b1a..52276d75 100644 --- a/components/account/AccountMoreButton.vue +++ b/components/account/AccountMoreButton.vue @@ -10,7 +10,7 @@ let relationship = $(useRelationship(account)) const isSelf = $(useSelfAccount(() => account)) const { t } = useI18n() -const masto = useMasto() +const { client } = $(useMasto()) const isConfirmed = async (title: string) => { return await openConfirmDialog(t('common.confirm_dialog.title', [title])) === 'confirm' @@ -22,10 +22,10 @@ const toggleMute = async (title: string) => { relationship!.muting = !relationship!.muting relationship = relationship!.muting - ? await masto.v1.accounts.mute(account.id, { + ? await client.v1.accounts.mute(account.id, { // TODO support more options }) - : await masto.v1.accounts.unmute(account.id) + : await client.v1.accounts.unmute(account.id) } const toggleBlockUser = async (title: string) => { @@ -33,7 +33,7 @@ const toggleBlockUser = async (title: string) => { return relationship!.blocking = !relationship!.blocking - relationship = await masto.v1.accounts[relationship!.blocking ? 'block' : 'unblock'](account.id) + relationship = await client.v1.accounts[relationship!.blocking ? 'block' : 'unblock'](account.id) } const toggleBlockDomain = async (title: string) => { @@ -41,7 +41,7 @@ const toggleBlockDomain = async (title: string) => { return relationship!.domainBlocking = !relationship!.domainBlocking - await masto.v1.domainBlocks[relationship!.domainBlocking ? 'block' : 'unblock'](getServerName(account)) + await client.v1.domainBlocks[relationship!.domainBlocking ? 'block' : 'unblock'](getServerName(account)) } const toggleReblogs = async (title: string) => { @@ -49,7 +49,7 @@ const toggleReblogs = async (title: string) => { return const showingReblogs = !relationship?.showingReblogs - relationship = await masto.v1.accounts.follow(account.id, { reblogs: showingReblogs }) + relationship = await client.v1.accounts.follow(account.id, { reblogs: showingReblogs }) } diff --git a/components/common/CommonPaginator.vue b/components/common/CommonPaginator.vue index 1191f17d..52feb76a 100644 --- a/components/common/CommonPaginator.vue +++ b/components/common/CommonPaginator.vue @@ -42,7 +42,7 @@ defineSlots<{ const { t } = useI18n() -const { items, prevItems, update, state, endAnchor, error } = usePaginator(paginator, stream, eventType, preprocess) +const { items, prevItems, update, state, endAnchor, error } = usePaginator(paginator, $$(stream), eventType, preprocess)