notedeck

One damus client to rule them all
git clone git://jb55.com/notedeck
Log | Files | Refs | README | LICENSE

commit 015e7790d0084abd9515ce5f34998c3a3d429a58
parent 9e21518e4bf8cedef4b820bd8da67800b166d9a8
Author: kernelkind <kernelkind@gmail.com>
Date:   Thu, 17 Apr 2025 18:52:17 -0400

move `WalletState` to UI

Signed-off-by: kernelkind <kernelkind@gmail.com>

Diffstat:
Mcrates/notedeck/src/lib.rs | 2+-
Mcrates/notedeck/src/wallet.rs | 12------------
Mcrates/notedeck_columns/src/nav.rs | 4++--
Mcrates/notedeck_columns/src/ui/wallet.rs | 14+++++++++++++-
4 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/crates/notedeck/src/lib.rs b/crates/notedeck/src/lib.rs @@ -64,7 +64,7 @@ pub use unknowns::{get_unknown_note_ids, NoteRefsUnkIdAction, SingleUnkIdAction, pub use urls::{supported_mime_hosted_at_url, SupportedMimeType, UrlMimes}; pub use user_account::UserAccount; pub use wallet::{ - get_wallet_for_mut, GlobalWallet, Wallet, WalletError, WalletState, WalletType, WalletUIState, + get_wallet_for_mut, GlobalWallet, Wallet, WalletError, WalletType, WalletUIState, }; pub use zaps::{ AnyZapState, NoteZapTarget, NoteZapTargetOwned, ZapTarget, ZapTargetOwned, ZappingError, diff --git a/crates/notedeck/src/wallet.rs b/crates/notedeck/src/wallet.rs @@ -10,18 +10,6 @@ use tokio::sync::RwLock; use crate::{Accounts, DataPath, TokenHandler}; -#[derive(Debug)] -pub enum WalletState<'a> { - Wallet { - wallet: &'a mut Wallet, - can_create_local_wallet: bool, - }, - NoWallet { - state: &'a mut WalletUIState, - show_local_only: bool, - }, -} - pub fn get_wallet_for_mut<'a>( accounts: &'a mut Accounts, global_wallet: &'a mut GlobalWallet, diff --git a/crates/notedeck_columns/src/nav.rs b/crates/notedeck_columns/src/nav.rs @@ -19,7 +19,7 @@ use crate::{ profile::EditProfileView, search::{FocusState, SearchView}, support::SupportView, - wallet::{WalletAction, WalletView}, + wallet::{WalletAction, WalletState, WalletView}, RelayView, }, Damus, @@ -27,7 +27,7 @@ use crate::{ use egui_nav::{Nav, NavAction, NavResponse, NavUiType}; use nostrdb::Transaction; -use notedeck::{AccountsAction, AppContext, NoteAction, NoteContext, WalletState}; +use notedeck::{AccountsAction, AppContext, NoteAction, NoteContext}; use notedeck_ui::View; use tracing::error; diff --git a/crates/notedeck_columns/src/ui/wallet.rs b/crates/notedeck_columns/src/ui/wallet.rs @@ -1,11 +1,23 @@ use egui::Layout; -use notedeck::{Accounts, GlobalWallet, Wallet, WalletError, WalletState, WalletUIState}; +use notedeck::{Accounts, GlobalWallet, Wallet, WalletError, WalletUIState}; use crate::route::{Route, Router}; use super::widgets::styled_button; #[derive(Debug)] +pub enum WalletState<'a> { + Wallet { + wallet: &'a mut Wallet, + can_create_local_wallet: bool, + }, + NoWallet { + state: &'a mut WalletUIState, + show_local_only: bool, + }, +} + +#[derive(Debug)] pub enum WalletAction { SaveURI, AddLocalOnly,