Skip to content

Conversation

@GabrielePicco
Copy link
Collaborator

@GabrielePicco GabrielePicco commented Jun 5, 2023

Add option to change disable default nfts loading

Status Type ⚠️ Core Change Issue
Ready Feature No -

Problem

Nfts are loaded by default when registering, this may not always be desired.

Solution

Added to boolean to change the default configuration.

  1. Web.LoadNftsTextureByDefault change the loading mechanism to only retrieve NFT metadata.
    private void OnEnable()
    {
        Web3.LoadNftsTextureByDefault = false;
        Web3.OnNFTsUpdate += OnNFTsUpdate;
    }
    
    private void OnDisable()
    {
        Web3.OnNFTsUpdate -= OnNFTsUpdate;
    }

    private void OnNFTsUpdate(List<Nft> nfts, int total)
    {
       // Nfts won't have the textures
    }
  1. Web.AutoLoadNfts controls the auto loading after the login, if set to false it can still be triggered manually calling LoadNFTs:
await Web3.LoadNFTs(loadTexture: false);

@GabrielePicco GabrielePicco merged commit 3008afe into main Jun 5, 2023
@GabrielePicco GabrielePicco deleted the enhance/improve-nft-loading-2 branch June 5, 2023 13:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant