fixes
This commit is contained in:
12
src/main.rs
12
src/main.rs
@@ -21,7 +21,7 @@ use tdlib_rs::enums::Update;
|
||||
use app::{App, AppScreen};
|
||||
use constants::{POLL_TIMEOUT_MS, SHUTDOWN_TIMEOUT_SECS};
|
||||
use input::{handle_auth_input, handle_main_input};
|
||||
use tdlib::client::AuthState;
|
||||
use tdlib::AuthState;
|
||||
use utils::disable_tdlib_logs;
|
||||
|
||||
#[tokio::main]
|
||||
@@ -127,12 +127,12 @@ async fn run_app<B: ratatui::backend::Backend>(
|
||||
}
|
||||
|
||||
// Обрабатываем очередь сообщений для отметки как прочитанных
|
||||
if !app.td_client.pending_view_messages.is_empty() {
|
||||
if !app.td_client.pending_view_messages().is_empty() {
|
||||
app.td_client.process_pending_view_messages().await;
|
||||
}
|
||||
|
||||
// Обрабатываем очередь user_id для загрузки имён
|
||||
if !app.td_client.pending_user_ids.is_empty() {
|
||||
if !app.td_client.pending_user_ids().is_empty() {
|
||||
app.td_client.process_pending_user_ids().await;
|
||||
}
|
||||
|
||||
@@ -199,7 +199,7 @@ async fn update_screen_state(app: &mut App) -> bool {
|
||||
let prev_error = app.error_message.clone();
|
||||
let prev_chats_len = app.chats.len();
|
||||
|
||||
match &app.td_client.auth_state {
|
||||
match &app.td_client.auth_state() {
|
||||
AuthState::WaitTdlibParameters => {
|
||||
app.screen = AppScreen::Loading;
|
||||
app.status_message = Some("Инициализация TDLib...".to_string());
|
||||
@@ -219,8 +219,8 @@ async fn update_screen_state(app: &mut App) -> bool {
|
||||
}
|
||||
|
||||
// Синхронизируем чаты из td_client в app
|
||||
if !app.td_client.chats.is_empty() {
|
||||
app.chats = app.td_client.chats.clone();
|
||||
if !app.td_client.chats().is_empty() {
|
||||
app.chats = app.td_client.chats().to_vec();
|
||||
if app.chat_list_state.selected().is_none() && !app.chats.is_empty() {
|
||||
app.chat_list_state.select(Some(0));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user