chore: fix status related type errors
This commit is contained in:
parent
95246393a1
commit
4ea4fadada
2 changed files with 7 additions and 5 deletions
|
|
@ -7,8 +7,8 @@ const props = defineProps<{
|
||||||
details?: boolean
|
details?: boolean
|
||||||
}>()
|
}>()
|
||||||
|
|
||||||
const { status }: { status: mastodon.v1.Status } = useStatusActions(props)
|
const { status } = useStatusActions(props)
|
||||||
function isCustomEmoji(emoji: EmojiReaction) {
|
function isCustomEmoji(emoji: mastodon.v1.EmojiReaction) {
|
||||||
return !!emoji.staticUrl
|
return !!emoji.staticUrl
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,14 @@
|
||||||
|
import type { mastodon } from 'masto'
|
||||||
|
|
||||||
type Action = 'reblogged' | 'favourited' | 'bookmarked' | 'pinned' | 'muted'
|
type Action = 'reblogged' | 'favourited' | 'bookmarked' | 'pinned' | 'muted'
|
||||||
type CountField = 'reblogsCount' | 'favouritesCount'
|
type CountField = 'reblogsCount' | 'favouritesCount'
|
||||||
|
|
||||||
export interface StatusActionsProps {
|
export interface StatusActionsProps {
|
||||||
status: Status
|
status: mastodon.v1.Status
|
||||||
}
|
}
|
||||||
|
|
||||||
export function useStatusActions(props: StatusActionsProps) {
|
export function useStatusActions(props: StatusActionsProps) {
|
||||||
const status = ref<Status>({ ...props.status })
|
const status = ref<mastodon.v1.Status>({ ...props.status })
|
||||||
const { client } = useMasto()
|
const { client } = useMasto()
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
|
|
@ -25,7 +27,7 @@ export function useStatusActions(props: StatusActionsProps) {
|
||||||
muted: false,
|
muted: false,
|
||||||
})
|
})
|
||||||
|
|
||||||
async function toggleStatusAction(action: Action, fetchNewStatus: () => Promise<Status>, countField?: CountField) {
|
async function toggleStatusAction(action: Action, fetchNewStatus: () => Promise<mastodon.v1.Status>, countField?: CountField) {
|
||||||
// check login
|
// check login
|
||||||
if (!checkLogin())
|
if (!checkLogin())
|
||||||
return
|
return
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue