don't expose mutable access to UserAccount
it's not preferable that the full mutable access is available to `ZapWallet`, but this PR is becoming too big already Signed-off-by: kernelkind <kernelkind@gmail.com>
This commit is contained in:
@@ -98,7 +98,7 @@ fn execute_note_action(
|
||||
router_action = Some(RouterAction::route_to(Route::quote(note_id)));
|
||||
}
|
||||
NoteAction::Zap(zap_action) => {
|
||||
let cur_acc = accounts.get_selected_account_mut();
|
||||
let cur_acc = accounts.get_selected_account();
|
||||
|
||||
let sender = cur_acc.key.pubkey;
|
||||
|
||||
|
||||
@@ -686,9 +686,7 @@ fn render_nav_body(
|
||||
Route::Wallet(wallet_type) => {
|
||||
let state = match wallet_type {
|
||||
notedeck::WalletType::Auto => 's: {
|
||||
if let Some(cur_acc_wallet) =
|
||||
&mut ctx.accounts.get_selected_account_mut().wallet
|
||||
{
|
||||
if let Some(cur_acc_wallet) = ctx.accounts.get_selected_wallet_mut() {
|
||||
let default_zap_state =
|
||||
get_default_zap_state(&mut cur_acc_wallet.default_zap);
|
||||
break 's WalletState::Wallet {
|
||||
@@ -713,8 +711,8 @@ fn render_nav_body(
|
||||
}
|
||||
}
|
||||
notedeck::WalletType::Local => 's: {
|
||||
let cur_acc = ctx.accounts.get_selected_account_mut();
|
||||
let Some(wallet) = &mut cur_acc.wallet else {
|
||||
let cur_acc = ctx.accounts.get_selected_wallet_mut();
|
||||
let Some(wallet) = cur_acc else {
|
||||
break 's WalletState::NoWallet {
|
||||
state: &mut ctx.global_wallet.ui_state,
|
||||
show_local_only: false,
|
||||
|
||||
@@ -63,9 +63,8 @@ impl WalletAction {
|
||||
let ui_state = &mut global_wallet.ui_state;
|
||||
if ui_state.for_local_only {
|
||||
ui_state.for_local_only = false;
|
||||
let cur_acc = accounts.get_selected_account_mut();
|
||||
|
||||
if cur_acc.wallet.is_some() {
|
||||
if accounts.get_selected_wallet_mut().is_some() {
|
||||
return None;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user