fix: keep selection on last/first message instead of deselecting
ci/woodpecker/pr/check Pipeline failed

When pressing down on the last message or up on the first message in
chat navigation, stay on the current message instead of exiting
message selection mode.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Mikhail KilinandClaude Opus 4.6 committed 2026-02-24 15:35:06 +03:00
1 parent 25c57c55fb
commit dfd4184039
1 file changed
+4 -8
+4 -8
View File
@@ -109,17 +109,13 @@ impl<T: TdClientTrait> MessageMethods<T> for App<T> {
} }
} }
if new_index >= total { if new_index < total {
self.chat_state = ChatState::Normal;
} else {
*selected_index = new_index; *selected_index = new_index;
self.stop_playback();
} }
self.stop_playback(); // Если new_index >= total — остаёмся на текущем
} else {
// Дошли до самого нового сообщения - выходим из режима выбора
self.chat_state = ChatState::Normal;
self.stop_playback();
} }
// Если уже на последнем — ничего не делаем, остаёмся на месте
} }
} }