Issue proper explorer URLs
This commit is contained in:
+22
-10
@@ -3,7 +3,7 @@
|
||||
%%% @end
|
||||
|
||||
-module(gd_gui).
|
||||
-vsn("0.5.6").
|
||||
-vsn("0.6.0").
|
||||
-author("Craig Everett <craigeverett@qpq.swiss>").
|
||||
-copyright("QPQ AG <info@qpq.swiss>").
|
||||
-license("GPL-3.0-or-later").
|
||||
@@ -691,15 +691,27 @@ copy_to_clipboard(String) ->
|
||||
end.
|
||||
|
||||
|
||||
www(State = #s{id = {_, #w{wx = ID_T}}}) ->
|
||||
String = wxStaticText:getLabel(ID_T),
|
||||
URL = unicode:characters_to_list(["https://aescan.io/accounts/", String]),
|
||||
ok =
|
||||
case wx_misc:launchDefaultBrowser(URL) of
|
||||
true -> log(info, "Opened in browser: ~ts", [URL]);
|
||||
false -> log(info, "Failed to open browser: ~ts", [URL])
|
||||
end,
|
||||
State.
|
||||
www(State = #s{id = {_, #w{wx = ID_T}}, j = J}) ->
|
||||
case wxStaticText:getLabel(ID_T) of
|
||||
"" ->
|
||||
ok = handle_troubling(State, J("No key selected.")),
|
||||
State;
|
||||
ID ->
|
||||
ok = www2(State, ID),
|
||||
State
|
||||
end.
|
||||
|
||||
www2(State = #s{j = J}, AccountID) ->
|
||||
case gd_con:network() of
|
||||
{ok, ChainID} ->
|
||||
URL = unicode:characters_to_list(["https://", ChainID, ".gajumaru.io/account/", AccountID]),
|
||||
case wx_misc:launchDefaultBrowser(URL) of
|
||||
true -> log(info, "Opened in browser: ~ts", [URL]);
|
||||
false -> log(info, "Failed to open browser: ~ts", [URL])
|
||||
end;
|
||||
none ->
|
||||
handle_troubling(State, J("No chain assigned."))
|
||||
end.
|
||||
|
||||
|
||||
spend(State = #s{accounts = []}) ->
|
||||
|
||||
Reference in New Issue
Block a user