From 5cdb770d236e7a126c6fa1fecdb387270a98e4aa Mon Sep 17 00:00:00 2001 From: Craig Everett Date: Sat, 1 Feb 2025 13:24:26 +0900 Subject: [PATCH] Tiny fixes - close_wallet bad match (derp) - don't crash on key creation with no wallet selected --- src/gmc_con.erl | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/gmc_con.erl b/src/gmc_con.erl index 139ad2b..e2e2d6f 100644 --- a/src/gmc_con.erl +++ b/src/gmc_con.erl @@ -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,