This little hack, tries to fix the bad Behavior hiding the chat behind the chat window.

This commit is contained in:
KK 2021-07-24 22:43:32 -07:00
parent 37077b5703
commit f473265fb0

View File

@ -214,6 +214,14 @@ impl<'a> Widget for Chat<'a> {
let chat_tabs = &chat_settings.chat_tabs;
let current_chat_tab = chat_settings.chat_tab_index.and_then(|i| chat_tabs.get(i));
// Empty old messages
state.update(|s| {
while s.messages.len() > MAX_MESSAGES {
s.messages.pop_front();
}
});
// Maintain scrolling //
if !self.new_messages.is_empty() {
//new messages - update chat w/ them & scroll down if at bottom of chat
@ -236,13 +244,6 @@ impl<'a> Widget for Chat<'a> {
state.update(|s| s.scroll_next = true); //make scroll happen only once any filters to the messages have already been applied
}
// Empty old messages
state.update(|s| {
while s.messages.len() > MAX_MESSAGES {
s.messages.pop_front();
}
});
if let Some(comps) = &self.force_completions {
state.update(|s| s.completions = comps.clone());
}