allow images from ['properties']['image']['description'] in nft token

pull/2753/head
Ayrat Badykov 5 years ago
parent 0955b10a8b
commit a9567fdf4f
No known key found for this signature in database
GPG Key ID: B44668E265E9396F
  1. 14
      apps/block_scout_web/lib/block_scout_web/views/tokens/instance/overview_view.ex

@ -21,9 +21,17 @@ defmodule BlockScoutWeb.Tokens.Instance.OverviewView do
def image_src(instance) do
cond do
instance.metadata && instance.metadata["image_url"] -> instance.metadata["image_url"]
instance.metadata && instance.metadata["image"] -> instance.metadata["image"]
true -> image_src(nil)
instance.metadata && instance.metadata["image_url"] ->
instance.metadata["image_url"]
instance.metadata && instance.metadata["image"] ->
instance.metadata["image"]
instance.metadata && instance.metadata["properties"]["image"]["description"] ->
instance.metadata["properties"]["image"]["description"]
true ->
image_src(nil)
end
end

Loading…
Cancel
Save