[backend/masto-client] Fall back to full-res url if an attachment's thumbnailUrl is null

The API docs say this field is nullable, but the official android app crashes if it is set to null.
This commit is contained in:
Laura Hausmann 2024-07-04 03:24:40 +02:00
parent e2b7d80871
commit 4f21fd9b91
No known key found for this signature in database
GPG Key ID: D044E84C5BE01605
2 changed files with 2 additions and 2 deletions

View File

@ -7,7 +7,7 @@ export class FileConverter {
type: this.encodefileType(f.type),
url: f.url ?? "",
remote_url: f.url,
preview_url: f.thumbnailUrl,
preview_url: f.thumbnailUrl ?? f.url ?? "",
text_url: f.url,
meta: {
width: f.properties.width,

View File

@ -40,7 +40,7 @@ namespace MastodonEntity {
type: "unknown" | "image" | "gifv" | "video" | "audio";
url: string;
remote_url: string | null;
preview_url: string | null;
preview_url: string;
text_url: string | null;
meta: Meta | null;
description: string | null;