explore: Do not initialize the list if it is already loading
This commit is contained in:
parent
971e1c2c33
commit
9b7bd5bb5e
|
@ -147,11 +147,13 @@ impl Explore {
|
|||
let imp = self.imp();
|
||||
|
||||
imp.servers_popover.init();
|
||||
imp.servers_button
|
||||
.set_label(imp.servers_popover.selected_server().unwrap().name());
|
||||
|
||||
if let Some(server) = imp.servers_popover.selected_server() {
|
||||
imp.servers_button.set_label(server.name());
|
||||
}
|
||||
|
||||
if let Some(public_room_list) = &*imp.public_room_list.borrow() {
|
||||
public_room_list.load_public_rooms(true);
|
||||
public_room_list.init();
|
||||
}
|
||||
|
||||
self.imp().search_entry.grab_focus();
|
||||
|
|
|
@ -150,6 +150,13 @@ impl PublicRoomList {
|
|||
self.notify("complete");
|
||||
}
|
||||
|
||||
pub fn init(&self) {
|
||||
// Initialize the list if it's not loading nor loaded.
|
||||
if !self.request_sent() && self.imp().list.borrow().is_empty() {
|
||||
self.load_public_rooms(true);
|
||||
}
|
||||
}
|
||||
|
||||
pub fn search(&self, search_term: Option<String>, server: Server) {
|
||||
let imp = self.imp();
|
||||
let network = Some(server.network());
|
||||
|
|
Loading…
Reference in New Issue