mirror of
https://github.com/versia-pub/frontend.git
synced 2025-12-06 08:28:20 +01:00
fix: 🐛 Show new posts when sent
This commit is contained in:
parent
7862757da7
commit
c586db3669
|
|
@ -179,7 +179,7 @@ const submit = async () => {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (relation?.type === "edit") {
|
if (relation?.type === "edit") {
|
||||||
await client.value.editStatus(relation.note.id, {
|
const { data } = await client.value.editStatus(relation.note.id, {
|
||||||
status: state.content,
|
status: state.content,
|
||||||
content_type: state.contentType,
|
content_type: state.contentType,
|
||||||
sensitive: state.sensitive,
|
sensitive: state.sensitive,
|
||||||
|
|
@ -190,22 +190,28 @@ const submit = async () => {
|
||||||
.map((f) => f.apiId)
|
.map((f) => f.apiId)
|
||||||
.filter((f) => f !== undefined),
|
.filter((f) => f !== undefined),
|
||||||
});
|
});
|
||||||
}
|
|
||||||
|
|
||||||
await client.value.postStatus(state.content, {
|
useEvent("composer:send-edit", data);
|
||||||
|
} else {
|
||||||
|
const { data } = await client.value.postStatus(state.content, {
|
||||||
content_type: state.contentType,
|
content_type: state.contentType,
|
||||||
sensitive: state.sensitive,
|
sensitive: state.sensitive,
|
||||||
spoiler_text: state.sensitive ? state.contentWarning : undefined,
|
spoiler_text: state.sensitive
|
||||||
|
? state.contentWarning
|
||||||
|
: undefined,
|
||||||
media_ids: state.files
|
media_ids: state.files
|
||||||
.map((f) => f.apiId)
|
.map((f) => f.apiId)
|
||||||
.filter((f) => f !== undefined),
|
.filter((f) => f !== undefined),
|
||||||
quote_id: relation?.type === "quote" ? relation.note.id : undefined,
|
quote_id:
|
||||||
|
relation?.type === "quote" ? relation.note.id : undefined,
|
||||||
in_reply_to_id:
|
in_reply_to_id:
|
||||||
relation?.type === "reply" ? relation.note.id : undefined,
|
relation?.type === "reply" ? relation.note.id : undefined,
|
||||||
visibility: state.visibility,
|
visibility: state.visibility,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
useEvent("composer:send", data as Status);
|
||||||
useEvent("composer:close");
|
useEvent("composer:close");
|
||||||
|
}
|
||||||
} catch (_e) {
|
} catch (_e) {
|
||||||
const e = _e as ResponseError;
|
const e = _e as ResponseError;
|
||||||
toast.error(e.message);
|
toast.error(e.message);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue