mirror of
https://github.com/versia-pub/server.git
synced 2025-12-06 08:28:19 +01:00
fix(api): 🚨 Correct duplicate assignments
This commit is contained in:
parent
8da9567ca2
commit
360ec4817c
|
|
@ -333,15 +333,13 @@ export default apiRoute((app) =>
|
||||||
await Emoji.parseFromText(sanitizedDisplayName);
|
await Emoji.parseFromText(sanitizedDisplayName);
|
||||||
const noteEmojis = await Emoji.parseFromText(self.note);
|
const noteEmojis = await Emoji.parseFromText(self.note);
|
||||||
|
|
||||||
self.emojis = [...displaynameEmojis, ...noteEmojis, ...fieldEmojis].map(
|
self.emojis = [...displaynameEmojis, ...noteEmojis, ...fieldEmojis]
|
||||||
(e) => e.data,
|
.map((e) => e.data)
|
||||||
);
|
.filter(
|
||||||
|
// Deduplicate emojis
|
||||||
// Deduplicate emojis
|
(emoji, index, self) =>
|
||||||
self.emojis = self.emojis.filter(
|
self.findIndex((e) => e.id === emoji.id) === index,
|
||||||
(emoji, index, self) =>
|
);
|
||||||
self.findIndex((e) => e.id === emoji.id) === index,
|
|
||||||
);
|
|
||||||
|
|
||||||
// Connect emojis, if any
|
// Connect emojis, if any
|
||||||
// Do it before updating user, so that federation takes that into account
|
// Do it before updating user, so that federation takes that into account
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue