server: fix empty array in quote detection
All checks were successful
ci/woodpecker/push/lint-foundkey-js Pipeline was successful
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/lint-backend Pipeline was successful
ci/woodpecker/push/lint-client Pipeline was successful
ci/woodpecker/push/lint-sw Pipeline was successful
ci/woodpecker/push/test Pipeline was successful
All checks were successful
ci/woodpecker/push/lint-foundkey-js Pipeline was successful
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/lint-backend Pipeline was successful
ci/woodpecker/push/lint-client Pipeline was successful
ci/woodpecker/push/lint-sw Pipeline was successful
ci/woodpecker/push/test Pipeline was successful
This commit is contained in:
parent
c792e4199c
commit
78f5ca3792
1 changed files with 4 additions and 4 deletions
|
@ -39,11 +39,11 @@ export function extractQuoteUrl(tags: IObject | IObject[] | null | undefined): s
|
|||
'https://www.w3.org/ns/activitystreams#quoteUrl',
|
||||
].includes(rel)
|
||||
)
|
||||
);
|
||||
)
|
||||
// Deduplicate by href.
|
||||
.filter((x, i, arr) => arr.findIndex(y => x.href === y.href) === i);
|
||||
|
||||
if (quotes.length === 0) return null;
|
||||
|
||||
// Deduplicate by href.
|
||||
// If there is more than one quote, we just pick the first/a random one.
|
||||
return quotes.filter((x, i, arr) => arr.findIndex(y => x.href === y.href) === i)[0].href;
|
||||
else return quotes[0].href;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue