kopia lustrzana https://github.com/elk-zone/elk
fix: ensure to clear the draft after posting
rodzic
d6c9caae6a
commit
8176ec9d47
|
@ -115,14 +115,7 @@ export function usePublish(options: {
|
|||
let status: mastodon.v1.Status
|
||||
if (!draft.value.editingStatus) {
|
||||
status = await client.value.v1.statuses.create(payload)
|
||||
|
||||
if (scheduledAt)
|
||||
// When created a scheduled post, it returns `mastodon.v1.ScheduledStatus` instead
|
||||
// We want to return only Status, which will be used to route to the posted status page
|
||||
// ref. Mastodon documentation - https://docs.joinmastodon.org/methods/statuses/#create
|
||||
return
|
||||
}
|
||||
|
||||
else {
|
||||
status = await client.value.v1.statuses.$select(draft.value.editingStatus.id).update({
|
||||
...payload,
|
||||
|
@ -137,6 +130,12 @@ export function usePublish(options: {
|
|||
|
||||
draft.value = options.initialDraft.value()
|
||||
|
||||
if (scheduledAt)
|
||||
// When created a scheduled post, it returns `mastodon.v1.ScheduledStatus` instead
|
||||
// We want to return only Status, which will be used to route to the posted status page
|
||||
// ref. Mastodon documentation - https://docs.joinmastodon.org/methods/statuses/#create
|
||||
return
|
||||
|
||||
return status
|
||||
}
|
||||
catch (err) {
|
||||
|
|
Ładowanie…
Reference in New Issue