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:
parent
3920a3e600
commit
1fa35adae7
|
@ -156,11 +156,11 @@ impl Event {
|
|||
..
|
||||
} => {
|
||||
let i = match app.ui.rooms_state.selected() {
|
||||
Some(i) => {
|
||||
if i > 0 {
|
||||
i - 1
|
||||
Some(cur) => {
|
||||
if cur > 0 {
|
||||
cur - 1
|
||||
} else {
|
||||
i
|
||||
cur
|
||||
}
|
||||
}
|
||||
None => 0,
|
||||
|
@ -173,11 +173,11 @@ impl Event {
|
|||
..
|
||||
} => {
|
||||
let i = match app.ui.rooms_state.selected() {
|
||||
Some(i) => {
|
||||
if i < app.status.rooms().len() {
|
||||
i + 1
|
||||
Some(cur) => {
|
||||
if cur < app.status.rooms().len() - 1 {
|
||||
cur + 1
|
||||
} else {
|
||||
i
|
||||
cur
|
||||
}
|
||||
}
|
||||
None => 0,
|
||||
|
|
|
@ -338,7 +338,10 @@ impl UI<'_> {
|
|||
(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,
|
||||
),
|
||||
};
|
||||
|
|
Reference in New Issue