fixes
This commit is contained in:
@@ -28,6 +28,8 @@ pub struct App {
|
||||
// Search state
|
||||
pub is_searching: bool,
|
||||
pub search_query: String,
|
||||
/// Флаг для оптимизации рендеринга - перерисовывать только при изменениях
|
||||
pub needs_redraw: bool,
|
||||
}
|
||||
|
||||
impl App {
|
||||
@@ -53,9 +55,15 @@ impl App {
|
||||
is_loading: true,
|
||||
is_searching: false,
|
||||
search_query: String::new(),
|
||||
needs_redraw: true,
|
||||
}
|
||||
}
|
||||
|
||||
/// Помечает UI как требующий перерисовки
|
||||
pub fn mark_dirty(&mut self) {
|
||||
self.needs_redraw = true;
|
||||
}
|
||||
|
||||
pub fn next_chat(&mut self) {
|
||||
let filtered = self.get_filtered_chats();
|
||||
if filtered.is_empty() {
|
||||
@@ -106,7 +114,9 @@ impl App {
|
||||
self.current_messages.clear();
|
||||
self.message_input.clear();
|
||||
self.message_scroll_offset = 0;
|
||||
// Очищаем данные в TdClient
|
||||
self.td_client.current_chat_id = None;
|
||||
self.td_client.current_chat_messages.clear();
|
||||
}
|
||||
|
||||
pub fn select_first_chat(&mut self) {
|
||||
|
||||
Reference in New Issue
Block a user