Skip to content

Commit

Permalink
UX Improvement (#58)
Browse files Browse the repository at this point in the history
* UX Improvement

* Clippy
  • Loading branch information
bjoernQ authored Nov 22, 2024
1 parent 8a3cd1a commit b1fd7fd
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

- Added missing init code in non-async template

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;
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 b1fd7fd

Please sign in to comment.