mirror of
https://github.com/Vendicated/Vencord.git
synced 2025-01-10 18:06:22 +00:00
fix(memberListActivities): get rid of duplicate icons
This commit is contained in:
parent
ab1ecd2b7f
commit
12ae29c389
1 changed files with 7 additions and 1 deletions
|
@ -178,9 +178,15 @@ export default definePlugin({
|
|||
});
|
||||
|
||||
if (icons.length) {
|
||||
const compareJSXElementsSource = (a: JSX.Element, b: JSX.Element) => {
|
||||
return a.props?.src === b.props?.src;
|
||||
};
|
||||
const uniqueIcons = icons.filter((element, index, array) => {
|
||||
return array.findIndex(el => compareJSXElementsSource(el, element)) === index;
|
||||
});
|
||||
return <ErrorBoundary noop>
|
||||
<div className={cl("row")}>
|
||||
{icons.map((icon, i) => (
|
||||
{uniqueIcons.map((icon, i) => (
|
||||
<div key={i} className={cl("icon")} style={{ width: `${settings.store.iconSize}px`, height: `${settings.store.iconSize}px` }}>
|
||||
{icon}
|
||||
</div>
|
||||
|
|
Loading…
Reference in a new issue