Tiny fixes

- close_wallet bad match (derp)
- don't crash on key creation with no wallet selected
This commit is contained in:
Craig Everett 2025-02-01 13:24:26 +09:00
parent 82c23bbfe6
commit 5cdb770d23

View File

@ -347,9 +347,9 @@ handle_cast({open_wallet, Path, Phrase}, State) ->
NewState = do_open_wallet(Path, Phrase, State),
{noreply, NewState};
handle_cast(close_wallet, State) ->
NewState = do_close_wallet(State),
NextState = do_close_wallet(State),
ok = gmc_gui:show([]),
ok = do_show_ui(gmc_v_wallman, NewState),
NewState = do_show_ui(gmc_v_wallman, NextState),
{noreply, NewState};
handle_cast({new_wallet, Name, Path, Password}, State) ->
NewState = do_new_wallet(Name, Path, Password, State),
@ -816,6 +816,9 @@ do_make_key(Name, Seed, base58, Transform, State) ->
end.
do_make_key2(_, _, _, State = #s{wallet = none}) ->
ok = gmc_gui:trouble("No wallet selected!"),
do_show_ui(gmc_v_wallman, State);
do_make_key2(Name, Bin, Transform,
State = #s{wallet = Current, wallets = Wallets, pass = Pass}) ->
#wallet{name = WalletName, poas = POAs, keys = Keys} = Current,