refactor: no reactivity transform (#2600)
This commit is contained in:
parent
b9394c2fa5
commit
ccfa7a8d10
102 changed files with 649 additions and 652 deletions
|
@ -9,7 +9,7 @@ const emit = defineEmits<{
|
|||
(event: 'change'): void
|
||||
}>()
|
||||
|
||||
const { client } = $(useMasto())
|
||||
const { client } = useMasto()
|
||||
|
||||
async function toggleFollowTag() {
|
||||
// We save the state so be can do an optimistic UI update, but fallback to the previous state if the API call fails
|
||||
|
@ -20,9 +20,9 @@ async function toggleFollowTag() {
|
|||
|
||||
try {
|
||||
if (previousFollowingState)
|
||||
await client.v1.tags.$select(tag.name).unfollow()
|
||||
await client.value.v1.tags.$select(tag.name).unfollow()
|
||||
else
|
||||
await client.v1.tags.$select(tag.name).follow()
|
||||
await client.value.v1.tags.$select(tag.name).follow()
|
||||
|
||||
emit('change')
|
||||
}
|
||||
|
|
|
@ -3,11 +3,11 @@ import type { mastodon } from 'masto'
|
|||
|
||||
const {
|
||||
tag,
|
||||
} = $defineProps<{
|
||||
} = defineProps<{
|
||||
tag: mastodon.v1.Tag
|
||||
}>()
|
||||
|
||||
const to = $computed(() => {
|
||||
const to = computed(() => {
|
||||
const { hostname, pathname } = new URL(tag.url)
|
||||
return `/${hostname}${pathname}`
|
||||
})
|
||||
|
@ -24,9 +24,9 @@ function onclick(evt: MouseEvent | KeyboardEvent) {
|
|||
|
||||
function go(evt: MouseEvent | KeyboardEvent) {
|
||||
if (evt.metaKey || evt.ctrlKey)
|
||||
window.open(to)
|
||||
window.open(to.value)
|
||||
else
|
||||
router.push(to)
|
||||
router.push(to.value)
|
||||
}
|
||||
</script>
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue