Skip to content

Commit

Permalink
切换链更新搜索列表数据
Browse files Browse the repository at this point in the history
  • Loading branch information
j1225335417 committed Oct 25, 2024
1 parent 7a35bb9 commit 4768cad
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions pages/collection/[address]/[[...tokenId1155]]/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,13 @@ const CollectionInfo = () => {
const { chain } = useNetwork();
const { loaded, loadColInfo, colInfo } = useCollectionInfo();


useEffect(() => {
if (chain && chain.id) {
const net = networkConfig[chain.id]
setDropdownOptions(collections
.filter((collection) => collection.network === net.networkName))
}
}, [chain])
useEffect(() => {
let chainConfig = {};
if (router.isReady) {
Expand All @@ -36,9 +42,8 @@ const CollectionInfo = () => {
async function setup() {
if (chain && chain.id in networkConfig)
chainConfig = networkConfig[chain.id];
console.log('colInfo.address', colInfo.address)
setDropdownOptions(collections
.filter((collection) => collection.network === chainConfig.networkName))


// 给个默认值显示eos,改成显示manta,不然会显示no data
if (chainConfig === undefined || chainConfig.networkName === undefined) {
chainConfig = networkConfig[169];
Expand Down

0 comments on commit 4768cad

Please sign in to comment.