fix: text min length is 1 (thanks mk)

This commit is contained in:
Mar0xy 2023-09-25 02:48:05 +02:00
parent df62b3786a
commit 645907851d
No known key found for this signature in database
GPG key ID: 56569BBE47D2C828

View file

@ -156,7 +156,7 @@ export class ApiStatusMastodon {
) {
body = normalizeQuery(body);
}
const text = body.status ? body.status : '';
const text = body.status ? body.status : ' ';
const removed = text.replace(/@\S+/g, '').replace(/\s|/g, '');
const isDefaultEmoji = emojiRegexAtStartToEnd.test(removed);
const isCustomEmoji = /^:[a-zA-Z0-9@_]+:$/.test(removed);