mirror of
https://github.com/elk-zone/elk.git
synced 2024-09-06 20:29:08 +01:00
feat(reply): navigate to thread on publish (#852)
This commit is contained in:
parent
c1aac9d2dc
commit
1817afdb23
3 changed files with 6 additions and 2 deletions
|
@ -159,6 +159,8 @@ async function publish() {
|
||||||
status = await masto.statuses.create(payload)
|
status = await masto.statuses.create(payload)
|
||||||
else
|
else
|
||||||
status = await masto.statuses.update(draft.editingStatus.id, payload)
|
status = await masto.statuses.update(draft.editingStatus.id, payload)
|
||||||
|
if (draft.params.inReplyToId)
|
||||||
|
navigateToStatus({ status })
|
||||||
|
|
||||||
draft = initial()
|
draft = initial()
|
||||||
emit('published', status)
|
emit('published', status)
|
||||||
|
|
|
@ -26,9 +26,8 @@ const reply = () => {
|
||||||
return
|
return
|
||||||
if (details)
|
if (details)
|
||||||
focusEditor()
|
focusEditor()
|
||||||
|
|
||||||
else
|
else
|
||||||
navigateTo({ path: getStatusRoute(status).href, state: { focusReply: true } })
|
navigateToStatus({ status, focusReply: true })
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
3
composables/status.ts
Normal file
3
composables/status.ts
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
import type { Status } from 'masto'
|
||||||
|
|
||||||
|
export const navigateToStatus = ({ status, focusReply = false }: { status: Status; focusReply?: boolean }) => navigateTo({ path: getStatusRoute(status).href, state: { focusReply } })
|
Loading…
Reference in a new issue