diff --git a/crates/settings/src/lib.rs b/crates/settings/src/lib.rs index c00c97d7..2e3b53d8 100644 --- a/crates/settings/src/lib.rs +++ b/crates/settings/src/lib.rs @@ -46,11 +46,8 @@ setting_accessors! { pub nip4e: bool, pub trusted_relays: Vec, pub file_server: Url, - pub recent_communities: Vec, } -const RECENT_COMMUNITIES_CAP: usize = 10; - /// Signer kind #[derive(Debug, Clone, Default, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord)] pub enum SignerKind { @@ -133,10 +130,6 @@ pub struct Settings { /// Server for blossom media attachments pub file_server: Url, - - /// Recently opened community ids, newest first - #[serde(default)] - pub recent_communities: Vec, } impl Default for Settings { @@ -149,7 +142,6 @@ impl Default for Settings { nip4e: false, trusted_relays: vec![], file_server: Url::parse(DEFAULT_FILE_SERVER).unwrap(), - recent_communities: vec![], } } } @@ -332,14 +324,4 @@ impl AppSettings { } }); } - - /// Move a community to the front of the recently opened list - pub fn record_recent_community(&mut self, id: String, cx: &mut Context) { - self.inner.update(cx, |this, cx| { - this.recent_communities.retain(|existing| existing != &id); - this.recent_communities.insert(0, id); - this.recent_communities.truncate(RECENT_COMMUNITIES_CAP); - cx.notify(); - }); - } }