mirror of
https://iceshrimp.dev/crimekillz/iceshrimp-161sh.git
synced 2024-11-25 05:29:07 +01:00
[mastodon-client] Fix handling of posts with empty cw / text field
This commit is contained in:
parent
73ac3048ef
commit
5d1bfd2e50
@ -318,9 +318,9 @@ export class NoteHelpers {
|
|||||||
public static normalizeComposeOptions(body: any): MastodonEntity.StatusCreationRequest {
|
public static normalizeComposeOptions(body: any): MastodonEntity.StatusCreationRequest {
|
||||||
const result: MastodonEntity.StatusCreationRequest = {};
|
const result: MastodonEntity.StatusCreationRequest = {};
|
||||||
|
|
||||||
if (body.status !== null)
|
if (body.status !== null && body.status.trim().length > 0)
|
||||||
result.text = body.status;
|
result.text = body.status;
|
||||||
if (body.spoiler_text !== null)
|
if (body.spoiler_text !== null && body.spoiler_text.trim().length > 0)
|
||||||
result.spoiler_text = body.spoiler_text;
|
result.spoiler_text = body.spoiler_text;
|
||||||
if (body.visibility !== null)
|
if (body.visibility !== null)
|
||||||
result.visibility = VisibilityConverter.decode(body.visibility);
|
result.visibility = VisibilityConverter.decode(body.visibility);
|
||||||
@ -352,9 +352,9 @@ export class NoteHelpers {
|
|||||||
public static normalizeEditOptions(body: any): MastodonEntity.StatusEditRequest {
|
public static normalizeEditOptions(body: any): MastodonEntity.StatusEditRequest {
|
||||||
const result: MastodonEntity.StatusEditRequest = {};
|
const result: MastodonEntity.StatusEditRequest = {};
|
||||||
|
|
||||||
if (body.status !== null)
|
if (body.status !== null && body.status.trim().length > 0)
|
||||||
result.text = body.status;
|
result.text = body.status;
|
||||||
if (body.spoiler_text !== null)
|
if (body.spoiler_text !== null && body.spoiler_text.trim().length > 0)
|
||||||
result.spoiler_text = body.spoiler_text;
|
result.spoiler_text = body.spoiler_text;
|
||||||
if (body.language !== null)
|
if (body.language !== null)
|
||||||
result.language = body.language;
|
result.language = body.language;
|
||||||
|
Loading…
Reference in New Issue
Block a user