wip: refactor

This commit is contained in:
2025-01-24 13:30:07 +07:00
parent 272259cd16
commit 3b6541b900
15 changed files with 99 additions and 93 deletions

View File

@@ -1,7 +1,5 @@
use crate::{
constants::{ALL_MESSAGES_SUB_ID, NEW_MESSAGE_SUB_ID},
get_client,
};
use crate::get_client;
use common::constants::{ALL_MESSAGES_SUB_ID, NEW_MESSAGE_SUB_ID};
use gpui::*;
use nostr_sdk::prelude::*;
use std::time::Duration;
@@ -81,10 +79,6 @@ impl AppRegistry {
.detach();
}
pub fn set_loading(&mut self) {
self.is_loading = false
}
pub fn set_user(&mut self, public_key: PublicKey, cx: &mut AppContext) {
self.user.update(cx, |model, cx| {
*model = Some(public_key);
@@ -94,13 +88,6 @@ impl AppRegistry {
self.is_loading = false;
}
pub fn set_refresh(&mut self, public_key: PublicKey, cx: &mut AppContext) {
self.refreshs.update(cx, |this, cx| {
this.push(public_key);
cx.notify();
})
}
pub fn current_user(&self) -> WeakModel<Option<PublicKey>> {
self.user.downgrade()
}