notedeck

One damus client to rule them all
git clone git://jb55.com/notedeck
Log | Files | Refs | README | LICENSE

view_state.rs (611B)


      1 use std::collections::HashMap;
      2 
      3 use enostr::Pubkey;
      4 
      5 use crate::deck_state::DeckState;
      6 use crate::login_manager::AcquireKeyState;
      7 use crate::profile_state::ProfileState;
      8 
      9 /// Various state for views
     10 #[derive(Default)]
     11 pub struct ViewState {
     12     pub login: AcquireKeyState,
     13     pub id_to_deck_state: HashMap<egui::Id, DeckState>,
     14     pub id_state_map: HashMap<egui::Id, AcquireKeyState>,
     15     pub id_string_map: HashMap<egui::Id, String>,
     16     pub pubkey_to_profile_state: HashMap<Pubkey, ProfileState>,
     17 }
     18 
     19 impl ViewState {
     20     pub fn login_mut(&mut self) -> &mut AcquireKeyState {
     21         &mut self.login
     22     }
     23 }