forked from trinitrix/core
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() {
|
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,
|
||||||
|
|
|
@ -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,
|
||||||
),
|
),
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue