pl-fe: improve statuses deduplication
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
parent
e24ec07017
commit
9686fa4af0
1 changed files with 2 additions and 2 deletions
|
@ -136,7 +136,7 @@ const deduplicateStatuses = (statuses: any[]) => {
|
|||
const deduplicatedStatuses: any[] = [];
|
||||
|
||||
for (const status of statuses) {
|
||||
const reblogged = status.reblog && deduplicatedStatuses.find((deduplicatedStatuses) => deduplicatedStatuses.reblog?.id === status.reblog.id);
|
||||
const reblogged = status.reblog && deduplicatedStatuses.find((deduplicatedStatus) => deduplicatedStatus.reblog?.id === status.reblog.id);
|
||||
|
||||
if (reblogged) {
|
||||
if (reblogged.accounts) {
|
||||
|
@ -145,7 +145,7 @@ const deduplicateStatuses = (statuses: any[]) => {
|
|||
reblogged.accounts = [reblogged.account, status.account];
|
||||
}
|
||||
reblogged.id += ':' + status.id;
|
||||
} else {
|
||||
} else if (!deduplicatedStatuses.find((deduplicatedStatus) => deduplicatedStatus.reblog?.id === status.id)) {
|
||||
deduplicatedStatuses.push(status);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue