feat: support more actions for user
This commit is contained in:
parent
3d7d2ca405
commit
84478984dc
12 changed files with 184 additions and 37 deletions
|
@ -6,11 +6,17 @@ const { account } = defineProps<{
|
|||
}>()
|
||||
|
||||
const isSelf = $computed(() => currentUser.value?.account.id === account.id)
|
||||
const relationship = $(useRelationship(account))
|
||||
let relationship = $(useRelationship(account))
|
||||
|
||||
async function toggleFollow() {
|
||||
relationship!.following = !relationship!.following
|
||||
await masto.accounts[relationship!.following ? 'follow' : 'unfollow'](account.id)
|
||||
try {
|
||||
relationship = await masto.accounts[relationship!.following ? 'follow' : 'unfollow'](account.id)
|
||||
}
|
||||
catch {
|
||||
// TODO error handling
|
||||
relationship!.following = !relationship!.following
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue