1
0
Fork 0

fix (ui): fixed rooms scroll out of bounds error and added more detail to 'not supported message like event' view in timeline

This commit is contained in:
antifallobst 2023-07-09 22:05:48 +02:00
parent 3920a3e600
commit 1fa35adae7
No known key found for this signature in database
2 changed files with 12 additions and 9 deletions

View File

@ -156,11 +156,11 @@ impl Event {
.. ..
} => { } => {
let i = match app.ui.rooms_state.selected() { let i = match app.ui.rooms_state.selected() {
Some(i) => { Some(cur) => {
if i > 0 { if cur > 0 {
i - 1 cur - 1
} else { } else {
i cur
} }
} }
None => 0, None => 0,
@ -173,11 +173,11 @@ impl Event {
.. ..
} => { } => {
let i = match app.ui.rooms_state.selected() { let i = match app.ui.rooms_state.selected() {
Some(i) => { Some(cur) => {
if i < app.status.rooms().len() { if cur < app.status.rooms().len() - 1 {
i + 1 cur + 1
} else { } else {
i cur
} }
} }
None => 0, None => 0,

View File

@ -338,7 +338,10 @@ impl UI<'_> {
(message_content.to_string(), Color::White) (message_content.to_string(), Color::White)
} }
_ => ( _ => (
"~~~ not supported message like event ~~~".to_string(), format!(
"~~~ not supported message like event: {} ~~~",
message_like_event.event_type().to_string()
),
Color::Red, Color::Red,
), ),
}; };