mirror of
https://github.com/aljazceru/notedeck.git
synced 2025-12-24 03:24:21 +01:00
@@ -1,5 +1,6 @@
|
|||||||
use crate::persist::{AppSizeHandler, ZoomHandler};
|
use crate::persist::{AppSizeHandler, ZoomHandler};
|
||||||
use crate::wallet::GlobalWallet;
|
use crate::wallet::GlobalWallet;
|
||||||
|
use crate::zaps::Zaps;
|
||||||
use crate::{
|
use crate::{
|
||||||
AccountStorage, Accounts, AppContext, Args, DataPath, DataPathType, Directory, Images,
|
AccountStorage, Accounts, AppContext, Args, DataPath, DataPathType, Directory, Images,
|
||||||
NoteCache, RelayDebugView, ThemeHandler, UnknownIds,
|
NoteCache, RelayDebugView, ThemeHandler, UnknownIds,
|
||||||
@@ -35,6 +36,7 @@ pub struct Notedeck {
|
|||||||
app_size: AppSizeHandler,
|
app_size: AppSizeHandler,
|
||||||
unrecognized_args: BTreeSet<String>,
|
unrecognized_args: BTreeSet<String>,
|
||||||
clipboard: Clipboard,
|
clipboard: Clipboard,
|
||||||
|
zaps: Zaps,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Our chrome, which is basically nothing
|
/// Our chrome, which is basically nothing
|
||||||
@@ -205,6 +207,7 @@ impl Notedeck {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let global_wallet = GlobalWallet::new(&path);
|
let global_wallet = GlobalWallet::new(&path);
|
||||||
|
let zaps = Zaps::default();
|
||||||
|
|
||||||
Self {
|
Self {
|
||||||
ndb,
|
ndb,
|
||||||
@@ -222,6 +225,7 @@ impl Notedeck {
|
|||||||
app_size,
|
app_size,
|
||||||
unrecognized_args,
|
unrecognized_args,
|
||||||
clipboard: Clipboard::new(None),
|
clipboard: Clipboard::new(None),
|
||||||
|
zaps,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -243,6 +247,7 @@ impl Notedeck {
|
|||||||
args: &self.args,
|
args: &self.args,
|
||||||
theme: &mut self.theme,
|
theme: &mut self.theme,
|
||||||
clipboard: &mut self.clipboard,
|
clipboard: &mut self.clipboard,
|
||||||
|
zaps: &mut self.zaps,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
use crate::{
|
use crate::{
|
||||||
wallet::GlobalWallet, Accounts, Args, DataPath, Images, NoteCache, ThemeHandler, UnknownIds,
|
wallet::GlobalWallet, zaps::Zaps, Accounts, Args, DataPath, Images, NoteCache, ThemeHandler,
|
||||||
|
UnknownIds,
|
||||||
};
|
};
|
||||||
use egui_winit::clipboard::Clipboard;
|
use egui_winit::clipboard::Clipboard;
|
||||||
|
|
||||||
@@ -20,4 +21,5 @@ pub struct AppContext<'a> {
|
|||||||
pub args: &'a Args,
|
pub args: &'a Args,
|
||||||
pub theme: &'a mut ThemeHandler,
|
pub theme: &'a mut ThemeHandler,
|
||||||
pub clipboard: &'a mut Clipboard,
|
pub clipboard: &'a mut Clipboard,
|
||||||
|
pub zaps: &'a mut Zaps,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -61,3 +61,5 @@ pub use wallet::{
|
|||||||
// export libs
|
// export libs
|
||||||
pub use enostr;
|
pub use enostr;
|
||||||
pub use nostrdb;
|
pub use nostrdb;
|
||||||
|
|
||||||
|
pub use zaps::Zaps;
|
||||||
@@ -14,6 +14,7 @@ use super::{
|
|||||||
type ZapId = u32;
|
type ZapId = u32;
|
||||||
|
|
||||||
#[allow(dead_code)]
|
#[allow(dead_code)]
|
||||||
|
#[derive(Default)]
|
||||||
pub struct Zaps {
|
pub struct Zaps {
|
||||||
next_id: ZapId,
|
next_id: ZapId,
|
||||||
zap_keys: hashbrown::HashMap<ZapKeyOwned, Vec<ZapId>>,
|
zap_keys: hashbrown::HashMap<ZapKeyOwned, Vec<ZapId>>,
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
mod cache;
|
mod cache;
|
||||||
mod networking;
|
mod networking;
|
||||||
mod zap;
|
mod zap;
|
||||||
|
|
||||||
|
pub use cache::Zaps;
|
||||||
|
|||||||
@@ -256,6 +256,7 @@ fn render_nav_body(
|
|||||||
ndb: ctx.ndb,
|
ndb: ctx.ndb,
|
||||||
img_cache: ctx.img_cache,
|
img_cache: ctx.img_cache,
|
||||||
note_cache: ctx.note_cache,
|
note_cache: ctx.note_cache,
|
||||||
|
zaps: ctx.zaps,
|
||||||
};
|
};
|
||||||
match top {
|
match top {
|
||||||
Route::Timeline(kind) => render_timeline_route(
|
Route::Timeline(kind) => render_timeline_route(
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ use egui::{Button, Color32, Hyperlink, Image, Response, RichText, Sense, Window}
|
|||||||
use nostrdb::{BlockType, Mention, Ndb, Note, NoteKey, Transaction};
|
use nostrdb::{BlockType, Mention, Ndb, Note, NoteKey, Transaction};
|
||||||
use tracing::warn;
|
use tracing::warn;
|
||||||
|
|
||||||
use notedeck::{supported_mime_hosted_at_url, Images, MediaCacheType, NoteCache};
|
use notedeck::{supported_mime_hosted_at_url, Images, MediaCacheType, NoteCache, Zaps};
|
||||||
|
|
||||||
/// Aggregates dependencies to reduce the number of parameters
|
/// Aggregates dependencies to reduce the number of parameters
|
||||||
/// passed to inner UI elements, minimizing prop drilling.
|
/// passed to inner UI elements, minimizing prop drilling.
|
||||||
@@ -17,6 +17,7 @@ pub struct NoteContext<'d> {
|
|||||||
pub ndb: &'d Ndb,
|
pub ndb: &'d Ndb,
|
||||||
pub img_cache: &'d mut Images,
|
pub img_cache: &'d mut Images,
|
||||||
pub note_cache: &'d mut NoteCache,
|
pub note_cache: &'d mut NoteCache,
|
||||||
|
pub zaps: &'d mut Zaps,
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct NoteContents<'a, 'd> {
|
pub struct NoteContents<'a, 'd> {
|
||||||
|
|||||||
@@ -732,6 +732,7 @@ mod preview {
|
|||||||
ndb: app.ndb,
|
ndb: app.ndb,
|
||||||
img_cache: app.img_cache,
|
img_cache: app.img_cache,
|
||||||
note_cache: app.note_cache,
|
note_cache: app.note_cache,
|
||||||
|
zaps: app.zaps,
|
||||||
};
|
};
|
||||||
|
|
||||||
PostView::new(
|
PostView::new(
|
||||||
|
|||||||
Reference in New Issue
Block a user