commit 0bcd84166dba7149d4b83c53cfbcafa021216259
parent c77246c231c19134b690a036202349246a18cf39
Author: kernelkind <kernelkind@gmail.com>
Date: Sun, 6 Apr 2025 17:16:48 -0400
integrate global wallet into app
Signed-off-by: kernelkind <kernelkind@gmail.com>
Diffstat:
2 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/crates/notedeck/src/app.rs b/crates/notedeck/src/app.rs
@@ -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,
diff --git a/crates/notedeck/src/context.rs b/crates/notedeck/src/context.rs
@@ -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,