Skip to content

Commit

Permalink
UX Improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
bjoernQ committed Nov 22, 2024
1 parent 0d89ed2 commit 40d7cb6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed

### Fixed
- Don't deselect just selected option

### Removed

Expand Down
5 changes: 4 additions & 1 deletion src/tui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ impl Repository {
self.selected.push(option.name.to_string());
}

let toggled_option = option.clone();
let currently_selected = self.selected.clone();
for option in currently_selected {
let Some(option) = find_option(&option, self.options) else {
Expand All @@ -79,7 +80,9 @@ impl Repository {
}
}
for disable in option.disables {
if self.selected.contains(&disable.to_string()) {
if disable != &toggled_option.name
&& self.selected.contains(&disable.to_string())
{
let Some(idx) = self.selected.iter().position(|v| v == disable) else {
ratatui::restore();
panic!("disable option not found");
Expand Down

0 comments on commit 40d7cb6

Please sign in to comment.