Skip to content

Commit

Permalink
Auto select the pool if there is only one (#434)
Browse files Browse the repository at this point in the history
  • Loading branch information
TristanDebrunner authored Nov 22, 2024
1 parent 94a3359 commit 1833d25
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions refbox/src/app/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2148,6 +2148,15 @@ impl Application for RefBoxApp {
}

if let Some(ref mut tournaments) = self.tournaments {
if let Some(pools) = tournament.pools.as_ref() {
if pools.len() == 1 {
if let Some(ref mut edits) = self.edited_settings {
if edits.current_pool.is_none() {
edits.current_pool = Some(pools[0].clone());
}
}
}
}
tournaments.insert(tournament.tid, tournament);
} else {
warn!(
Expand Down

0 comments on commit 1833d25

Please sign in to comment.