mirror of
https://github.com/aljazceru/notedeck.git
synced 2025-12-19 17:44:18 +01:00
add onboarding related state to app
Signed-off-by: kernelkind <kernelkind@gmail.com>
This commit is contained in:
@@ -4,6 +4,7 @@ use crate::{
|
|||||||
decks::{Decks, DecksCache},
|
decks::{Decks, DecksCache},
|
||||||
draft::Drafts,
|
draft::Drafts,
|
||||||
nav::{self, ProcessNavResult},
|
nav::{self, ProcessNavResult},
|
||||||
|
onboarding::Onboarding,
|
||||||
options::AppOptions,
|
options::AppOptions,
|
||||||
route::Route,
|
route::Route,
|
||||||
storage,
|
storage,
|
||||||
@@ -58,6 +59,9 @@ pub struct Damus {
|
|||||||
pub note_options: NoteOptions,
|
pub note_options: NoteOptions,
|
||||||
|
|
||||||
pub unrecognized_args: BTreeSet<String>,
|
pub unrecognized_args: BTreeSet<String>,
|
||||||
|
|
||||||
|
/// keep track of follow packs
|
||||||
|
pub onboarding: Onboarding,
|
||||||
}
|
}
|
||||||
|
|
||||||
fn handle_key_events(input: &egui::InputState, columns: &mut Columns) {
|
fn handle_key_events(input: &egui::InputState, columns: &mut Columns) {
|
||||||
@@ -169,6 +173,10 @@ fn try_process_event(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if let Some(follow_packs) = damus.onboarding.get_follow_packs_mut() {
|
||||||
|
follow_packs.poll_for_notes(app_ctx.ndb, app_ctx.unknown_ids);
|
||||||
|
}
|
||||||
|
|
||||||
if app_ctx.unknown_ids.ready_to_send() {
|
if app_ctx.unknown_ids.ready_to_send() {
|
||||||
unknown_id_send(app_ctx.unknown_ids, app_ctx.pool);
|
unknown_id_send(app_ctx.unknown_ids, app_ctx.pool);
|
||||||
}
|
}
|
||||||
@@ -517,6 +525,7 @@ impl Damus {
|
|||||||
unrecognized_args,
|
unrecognized_args,
|
||||||
jobs,
|
jobs,
|
||||||
threads,
|
threads,
|
||||||
|
onboarding: Onboarding::default(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -567,6 +576,7 @@ impl Damus {
|
|||||||
unrecognized_args: BTreeSet::default(),
|
unrecognized_args: BTreeSet::default(),
|
||||||
jobs: JobsCache::default(),
|
jobs: JobsCache::default(),
|
||||||
threads: Threads::default(),
|
threads: Threads::default(),
|
||||||
|
onboarding: Onboarding::default(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
|
|
||||||
use enostr::Pubkey;
|
use enostr::Pubkey;
|
||||||
|
use notedeck_ui::nip51_set::Nip51SetUiCache;
|
||||||
|
|
||||||
use crate::deck_state::DeckState;
|
use crate::deck_state::DeckState;
|
||||||
use crate::login_manager::AcquireKeyState;
|
use crate::login_manager::AcquireKeyState;
|
||||||
@@ -25,6 +26,9 @@ pub struct ViewState {
|
|||||||
/// fullscreen media viewier, as well as any other state we want to
|
/// fullscreen media viewier, as well as any other state we want to
|
||||||
/// keep track of
|
/// keep track of
|
||||||
pub media_viewer: MediaViewerState,
|
pub media_viewer: MediaViewerState,
|
||||||
|
|
||||||
|
/// Keep track of checkbox state of follow pack onboarding
|
||||||
|
pub follow_packs: Nip51SetUiCache,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl ViewState {
|
impl ViewState {
|
||||||
|
|||||||
Reference in New Issue
Block a user