...
 
Commits (2)
......@@ -875,7 +875,12 @@ and unlock_session id f state =
let update_balance state =
let cb () =
Node.get_account_info ~network:state.fo_net state.fo_acc.pkh
Node.get_account_info ~network:state.fo_net
~error:(fun _code _content ->
replace1 main_balance_value_id @@
span ~a:[ a_title "cannot get account info"; a_class [Color.danger_tx] ] [
txt "--" ])
state.fo_acc.pkh
(fun {Dune_types_min.node_ai_balance; _} -> replace1 main_balance_value_id
(Dun.pp_amount node_ai_balance)) in
Timer.clear_create ~name:"balance" 30 cb
......@@ -1330,7 +1335,7 @@ let update_central_view refresh state =
[ img ~src:"img/dune-logo-square.png" ~alt:"Dune Metal" () ] in
let balance_container =
span ~a:[ a_id main_balance_value_id ] [
Dun.pp_amount Int64.zero
txt "--"
] in
let send_buttons_container =
div ~a:[ a_class [ "main-buttons" ; Spacing.mb3 ] ] [
......
......@@ -64,7 +64,12 @@ let update_network refresh state =
let update_account_info state =
let cb () =
Metal_request.Node.get_account_info ~network:state.ho_net state.ho_acc.pkh
Metal_request.Node.get_account_info ~network:state.ho_net
~error:(fun _code _content ->
replace1 balance_home_id @@
span ~a:[ a_title "cannot get account info"; a_class [Color.danger_tx] ] [
txt "--" ])
state.ho_acc.pkh
(fun ai ->
replace1 balance_home_id (Dun.pp_amount ai.Dune_types_min.node_ai_balance);
update_account_admin ~accounts:state.ho_accs state.ho_net state.ho_acc ai;
......@@ -339,7 +344,7 @@ let update_account refresh state =
div ~a:[ a_class [Sizing.w50; Spacing.my4; Spacing.mxa] ] [
blockies ~classes:["main-blockies"] state.ho_acc.pkh; br ();
span ~a:[ a_class [Badge.badge; Badge.badge_pill; Badge.badge_dark] ] [ revealed ] ];
span ~a:[ a_id balance_home_id; a_class [Spacing.my4] ] [ Dun.pp_amount Int64.zero ]
span ~a:[ a_id balance_home_id; a_class [Spacing.my4] ] [ txt "--" ]
];
info_div;
notif_div;
......