fix: remove duplicate metdata caused by searching all whitelisted creators for the store
This commit is contained in:
parent
301e832f27
commit
fc94a8a2af
|
@ -0,0 +1 @@
|
||||||
|
nodejs 14.17.1
|
|
@ -19,6 +19,7 @@ import {
|
||||||
decodeMetadata,
|
decodeMetadata,
|
||||||
getAuctionExtended,
|
getAuctionExtended,
|
||||||
} from '../../actions';
|
} from '../../actions';
|
||||||
|
import { uniqWith } from 'lodash';
|
||||||
import { WhitelistedCreator } from '../../models/metaplex';
|
import { WhitelistedCreator } from '../../models/metaplex';
|
||||||
import { Connection, PublicKey } from '@solana/web3.js';
|
import { Connection, PublicKey } from '@solana/web3.js';
|
||||||
import {
|
import {
|
||||||
|
@ -304,7 +305,11 @@ export const loadAccounts = async (connection: Connection) => {
|
||||||
|
|
||||||
await Promise.all(loading);
|
await Promise.all(loading);
|
||||||
|
|
||||||
console.log('Metadata size', state.metadata.length);
|
state.metadata = uniqWith(
|
||||||
|
state.metadata,
|
||||||
|
(a: ParsedAccount<Metadata>, b: ParsedAccount<Metadata>) =>
|
||||||
|
a.pubkey === b.pubkey,
|
||||||
|
);
|
||||||
|
|
||||||
return state;
|
return state;
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,3 +1,6 @@
|
||||||
/// <reference types="next" />
|
/// <reference types="next" />
|
||||||
/// <reference types="next/types/global" />
|
/// <reference types="next/types/global" />
|
||||||
/// <reference types="next/image-types/global" />
|
/// <reference types="next/image-types/global" />
|
||||||
|
|
||||||
|
// NOTE: This file should not be edited
|
||||||
|
// see https://nextjs.org/docs/basic-features/typescript for more information.
|
||||||
|
|
Loading…
Reference in New Issue