refactor: sync masto (#1121)

This commit is contained in:
三咲智子 Kevin Deng 2023-01-15 16:38:02 +08:00 committed by GitHub
parent eb1f769e32
commit 4422a57f49
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
81 changed files with 397 additions and 367 deletions

View file

@ -39,7 +39,7 @@ const toggleTranslation = async () => {
isLoading.translation = false
}
const masto = useMasto()
const { client } = $(useMasto())
const getPermalinkUrl = (status: mastodon.v1.Status) => {
const url = getStatusPermalinkRoute(status)
@ -70,7 +70,7 @@ const deleteStatus = async () => {
return
removeCachedStatus(status.id)
await masto.v1.statuses.remove(status.id)
await client.v1.statuses.remove(status.id)
if (route.name === 'status')
router.back()
@ -88,7 +88,7 @@ const deleteAndRedraft = async () => {
}
removeCachedStatus(status.id)
await masto.v1.statuses.remove(status.id)
await client.v1.statuses.remove(status.id)
await openPublishDialog('dialog', await getDraftFromStatus(status), true)
// Go to the new status, if the page is the old status
@ -214,7 +214,7 @@ const showFavoritedAndBoostedBy = () => {
@click="toggleTranslation"
/>
<template v-if="isMastoInitialised && currentUser">
<template v-if="isHydrated && currentUser">
<template v-if="isAuthor">
<CommonDropdownItem
:text="status.pinned ? $t('menu.unpin_on_profile') : $t('menu.pin_on_profile')"