fedimbed: fix another gts moment (emotes not being array)
This commit is contained in:
parent
a7c17c195b
commit
79cf9b9be7
1 changed files with 6 additions and 2 deletions
|
@ -408,10 +408,14 @@ async function processUrl(msg, url, spoiler = false) {
|
||||||
cw = postData.summary;
|
cw = postData.summary;
|
||||||
timestamp = postData.published;
|
timestamp = postData.published;
|
||||||
|
|
||||||
if (postData.tag)
|
if (postData.tag) {
|
||||||
emotes = postData.tag
|
let tag = postData.tag;
|
||||||
|
// gts moment
|
||||||
|
if (!Array.isArray(tag)) tag = [tag];
|
||||||
|
emotes = tag
|
||||||
.filter((x) => !!x.icon)
|
.filter((x) => !!x.icon)
|
||||||
.map((x) => ({name: x.name, url: x.icon.url}));
|
.map((x) => ({name: x.name, url: x.icon.url}));
|
||||||
|
}
|
||||||
|
|
||||||
// NB: gts doesnt send singular attachments as areay
|
// NB: gts doesnt send singular attachments as areay
|
||||||
const attachments = Array.isArray(postData.attachment)
|
const attachments = Array.isArray(postData.attachment)
|
||||||
|
|
Loading…
Reference in a new issue