fix: only sort if no containers currently set, i.e. on first attempt

This commit is contained in:
Jack Wills
2022-12-05 13:50:14 +00:00
parent bfb3b82630
commit 552c26bc5c
+3 -1
View File
@@ -445,8 +445,10 @@ impl AppData {
pub fn update_containers(&mut self, all_containers: &mut [ContainerSummary]) {
let all_ids = self.get_all_ids();
// Sort the containes by created, that have a constant order
// Only sort it no containers currently set, as afterwards the order is fixed
if self.containers.items.is_empty() {
all_containers.sort_by(|a, b| a.created.cmp(&b.created));
}
if !all_containers.is_empty() && self.containers.state.selected().is_none() {
self.containers.start();