Skip to content

Commit

Permalink
Fix: Remove duplicates from synchronizing (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
RikudouSage authored Sep 12, 2023
1 parent 31f4764 commit db65427
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,17 @@ export class SynchronizeLemmyComponent implements OnInit {
}
}

return [...this.cache[myInstance]!, ...foreignInstanceBlacklist];
const result = [...this.cache[myInstance]!, ...foreignInstanceBlacklist];
const handled: string[] = [];

return result.filter(instance => {
if (handled.includes(instance.domain)) {
return false;
}

handled.push(instance.domain);
return true;
});
})();

return this.cache[cacheKey]!;
Expand Down

0 comments on commit db65427

Please sign in to comment.