holaplex / metaplex

The Metaplex protocol
https://metaplex.com
Apache License 2.0
5 stars 20 forks source link

Query Whitelisted Creators in the Background #293

Open kristianeboe opened 2 years ago

kristianeboe commented 2 years ago

Issue One of the remaining slowish queries on main site load is for whitelisted creators. This listed is needed for showing the create button and some other administrative items.

Goal Move querying of whitelisted creators to the background showing spinners on areas requiring it but don’t block site load because of it.

kristianeboe commented 2 years ago

here is the current query: metaplex/loadAccounts.ts at dev · holaplex/metaplex

Its called from the large loadAccount that getting initial batch of data needed for the site.

metaplex/loadAccounts.ts at dev · holaplex/metaplex

And here is an example of the whitelisted creators being read to hide/show create button.

metaplex/index.tsx at dev · holaplex/metaplex

Idea I had that still used useMeta was to default whitelistedCreators in meta state to null. Anywhere trying to access creators should interpret null as loading and show spinner. Once replaced with {} assume all creators were queried and use previous logic.