Fix refresh on step 2

This commit is contained in:
Ivan Yaremenchuk 2022-04-04 01:16:13 +02:00
parent b77ca7a50a
commit 40e6353248
1 changed files with 7 additions and 5 deletions

View File

@ -66,14 +66,16 @@ public class Step2Component : BasicComponent
private string GetCurrentMetadataJson()
{
var imageUrl = IpfsService.GetUrlToGateway(AppState.Storage.IpfsImageUrl, AppState.Storage.IpfsGatewayType);
var imageUrl = AppState?.Storage?.IpfsImageUrl != null
? IpfsService.GetUrlToGateway(AppState.Storage.IpfsImageUrl, AppState.Storage.IpfsGatewayType)
: null;
var metadata = new TokenMetadata
{
Name = AppState.Storage.TokenName,
Description = AppState.Storage.TokenDescription,
Image = imageUrl.OriginalString,
ExternalUrl = "https://nft-faucet.darkcodi.xyz/",
Name = AppState?.Storage?.TokenName,
Description = AppState?.Storage?.TokenDescription,
Image = imageUrl?.OriginalString,
ExternalUrl = "https://darkcodi.github.io/nft-faucet/",
};
var metadataJson = JsonConvert.SerializeObject(metadata, Formatting.Indented);