integrate global wallet into app

Signed-off-by: kernelkind <kernelkind@gmail.com>
This commit is contained in:
kernelkind
2025-04-06 17:16:48 -04:00
parent c77246c231
commit 0bcd84166d
2 changed files with 10 additions and 1 deletions

View File

@@ -1,4 +1,5 @@
use crate::persist::{AppSizeHandler, ZoomHandler};
use crate::wallet::GlobalWallet;
use crate::{
AccountStorage, Accounts, AppContext, Args, DataPath, DataPathType, Directory, Images,
NoteCache, RelayDebugView, ThemeHandler, UnknownIds,
@@ -25,6 +26,7 @@ pub struct Notedeck {
pool: RelayPool,
note_cache: NoteCache,
accounts: Accounts,
global_wallet: GlobalWallet,
path: DataPath,
args: Args,
theme: ThemeHandler,
@@ -202,6 +204,8 @@ impl Notedeck {
error!("error migrating image cache: {e}");
}
let global_wallet = GlobalWallet::new(&path);
Self {
ndb,
img_cache,
@@ -209,6 +213,7 @@ impl Notedeck {
pool,
note_cache,
accounts,
global_wallet,
path: path.clone(),
args: parsed_args,
theme,
@@ -233,6 +238,7 @@ impl Notedeck {
pool: &mut self.pool,
note_cache: &mut self.note_cache,
accounts: &mut self.accounts,
global_wallet: &mut self.global_wallet,
path: &self.path,
args: &self.args,
theme: &mut self.theme,

View File

@@ -1,4 +1,6 @@
use crate::{Accounts, Args, DataPath, Images, NoteCache, ThemeHandler, UnknownIds};
use crate::{
wallet::GlobalWallet, Accounts, Args, DataPath, Images, NoteCache, ThemeHandler, UnknownIds,
};
use egui_winit::clipboard::Clipboard;
use enostr::RelayPool;
@@ -13,6 +15,7 @@ pub struct AppContext<'a> {
pub pool: &'a mut RelayPool,
pub note_cache: &'a mut NoteCache,
pub accounts: &'a mut Accounts,
pub global_wallet: &'a mut GlobalWallet,
pub path: &'a DataPath,
pub args: &'a Args,
pub theme: &'a mut ThemeHandler,