File tree Expand file tree Collapse file tree 1 file changed +18
-10
lines changed
explorer/lib/explorer_web/live/pages/batch Expand file tree Collapse file tree 1 file changed +18
-10
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,21 @@ defmodule ExplorerWeb.Batch.Index do
22 require Logger
33 use ExplorerWeb , :live_view
44
5+ defp set_empty_values ( socket ) do
6+ Logger . info ( "Setting empty values" )
7+
8+ socket
9+ |> assign (
10+ merkle_root: :empty ,
11+ current_batch: :empty ,
12+ newBatchInfo: :empty ,
13+ batchWasResponded: :empty ,
14+ proof_hashes: :empty ,
15+ proofs: :empty ,
16+ eth_usd_price: :empty
17+ )
18+ end
19+
520 @ impl true
621 def mount ( % { "merkle_root" => merkle_root } , _ , socket ) do
722 if connected? ( socket ) , do: Phoenix.PubSub . subscribe ( Explorer.PubSub , "update_views" )
@@ -38,16 +53,9 @@ defmodule ExplorerWeb.Batch.Index do
3853 rescue
3954 _ ->
4055 { :ok ,
41- socket
42- |> assign (
43- merkle_root: :empty ,
44- current_batch: :empty ,
45- newBatchInfo: :empty ,
46- batchWasResponded: :empty ,
47- proof_hashes: :empty ,
48- proofs: :empty ,
49- eth_usd_price: :empty
50- ) }
56+ set_empty_values ( socket )
57+ |> put_flash ( :error , "Something went wrong, please try again later." )
58+ }
5159 end
5260
5361 @ impl true
You can’t perform that action at this time.
0 commit comments