[mastodon-client] Emoji category should be string or undefined

This commit is contained in:
Laura Hausmann 2023-10-05 15:09:06 +02:00
parent 3132ff5ca0
commit 98b451bf05
No known key found for this signature in database
GPG Key ID: D044E84C5BE01605
3 changed files with 4 additions and 4 deletions

View File

@ -1,13 +1,13 @@
import { PopulatedEmoji } from "@/misc/populate-emojis.js";
export class EmojiConverter {
public static encode(e: PopulatedEmoji) {
public static encode(e: PopulatedEmoji): MastodonEntity.Emoji {
return {
shortcode: e.name,
static_url: e.url,
url: e.url,
visible_in_picker: true,
category: null
category: undefined
};
}
}

View File

@ -4,6 +4,6 @@ namespace MastodonEntity {
static_url: string;
url: string;
visible_in_picker: boolean;
category: string;
category: string | undefined;
};
}

View File

@ -199,7 +199,7 @@ export class MiscHelpers {
.map(x => {
return {
...x,
category: dbRes.find(y => y.name === x.shortcode)?.category ?? null
category: dbRes.find(y => y.name === x.shortcode)?.category ?? undefined
}
})
)