Skip to content

Commit

Permalink
editor: fix half width new theme button on round tab
Browse files Browse the repository at this point in the history
  • Loading branch information
barsoosayque committed Dec 1, 2024
1 parent 3cc2ad8 commit 5c2ec74
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions crates/opensi-editor/src/app/round_tab.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,13 @@ fn round_themes(
let Some(round) = package.get_round(idx) else {
return;
};
let max_theme_len =
round.themes.iter().map(|theme| theme.questions.len()).max().unwrap_or_default();
(max_theme_len + 2, round.themes.len() + 1)
if round.themes.is_empty() {
(1, 1)
} else {
let max_theme_len =
round.themes.iter().map(|theme| theme.questions.len()).max().unwrap_or_default();
(max_theme_len + 2, round.themes.len() + 1)
}
};

CardTable::new("round-themes").show(ui, count, |mut row| {
Expand Down

0 comments on commit 5c2ec74

Please sign in to comment.