propagate JobsCache

Signed-off-by: kernelkind <kernelkind@gmail.com>
This commit is contained in:
kernelkind
2025-04-18 22:48:57 -05:00
parent e6212e5d17
commit a29277d263
15 changed files with 153 additions and 42 deletions

View File

@@ -3,6 +3,7 @@ pub mod context;
pub mod options;
pub mod reply_description;
use crate::jobs::JobsCache;
use crate::{
profile::name::one_line_display_name_widget, widgets::x_button, ImagePulseTint, ProfilePic,
ProfilePreview, Username,
@@ -32,6 +33,7 @@ pub struct NoteView<'a, 'd> {
note: &'a nostrdb::Note<'a>,
framed: bool,
flags: NoteOptions,
jobs: &'a mut JobsCache,
}
pub struct NoteResponse {
@@ -73,6 +75,7 @@ impl<'a, 'd> NoteView<'a, 'd> {
cur_acc: &'a Option<KeypairUnowned<'a>>,
note: &'a nostrdb::Note<'a>,
mut flags: NoteOptions,
jobs: &'a mut JobsCache,
) -> Self {
flags.set_actionbar(true);
flags.set_note_previews(true);
@@ -87,6 +90,7 @@ impl<'a, 'd> NoteView<'a, 'd> {
note,
flags,
framed,
jobs,
}
}
@@ -212,6 +216,7 @@ impl<'a, 'd> NoteView<'a, 'd> {
txn,
self.note,
self.flags,
self.jobs,
));
//});
})
@@ -326,7 +331,14 @@ impl<'a, 'd> NoteView<'a, 'd> {
.text_style(style.text_style()),
);
});
NoteView::new(self.note_context, self.cur_acc, &note_to_repost, self.flags).show(ui)
NoteView::new(
self.note_context,
self.cur_acc,
&note_to_repost,
self.flags,
self.jobs,
)
.show(ui)
} else {
self.show_standard(ui)
}
@@ -426,6 +438,7 @@ impl<'a, 'd> NoteView<'a, 'd> {
&note_reply,
self.note_context,
self.flags,
self.jobs,
)
})
.inner;
@@ -437,8 +450,14 @@ impl<'a, 'd> NoteView<'a, 'd> {
});
});
let mut contents =
NoteContents::new(self.note_context, self.cur_acc, txn, self.note, self.flags);
let mut contents = NoteContents::new(
self.note_context,
self.cur_acc,
txn,
self.note,
self.flags,
self.jobs,
);
ui.add(&mut contents);
@@ -489,6 +508,7 @@ impl<'a, 'd> NoteView<'a, 'd> {
&note_reply,
self.note_context,
self.flags,
self.jobs,
);
if action.is_some() {
@@ -503,6 +523,7 @@ impl<'a, 'd> NoteView<'a, 'd> {
txn,
self.note,
self.flags,
self.jobs,
);
ui.add(&mut contents);