Fix sort order for rooms waiting to reconnect
This commit is contained in:
parent
f2d70f99eb
commit
b6d69ce0b5
1 changed files with 2 additions and 5 deletions
|
|
@ -291,11 +291,8 @@ impl Rooms {
|
||||||
match self.order {
|
match self.order {
|
||||||
Order::Alphabet => rooms.sort_unstable_by_key(|(n, _, _)| *n),
|
Order::Alphabet => rooms.sort_unstable_by_key(|(n, _, _)| *n),
|
||||||
Order::Importance => rooms.sort_unstable_by_key(|(n, s, u)| {
|
Order::Importance => rooms.sort_unstable_by_key(|(n, s, u)| {
|
||||||
let connecting_or_connected = matches!(
|
let no_instance = matches!(s, None | Some(euph::State::Disconnected));
|
||||||
s,
|
(no_instance, *u == 0, *n)
|
||||||
Some(euph::State::Connecting | euph::State::Connected(_, _))
|
|
||||||
);
|
|
||||||
(!connecting_or_connected, *u == 0, *n)
|
|
||||||
}),
|
}),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue