mirror of
https://github.com/ClementTsang/bottom
synced 2024-11-22 12:13:06 +00:00
bug: Fix bug caused by hitting enter w/ a failed dd
This would cause the dd fields to get stuck due to never resetting.
This commit is contained in:
parent
f3897f0538
commit
d211c6474c
2 changed files with 13 additions and 5 deletions
|
@ -29,6 +29,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||
|
||||
- [183](https://github.com/ClementTsang/bottom/pull/183): Fixed bug in basic mode where the battery widget was placed incorrectly.
|
||||
|
||||
- [186](https://github.com/ClementTsang/bottom/pull/186): Fixed a bug caused by hitting `Enter` when a process kill fails, breaking future process kills.
|
||||
|
||||
## [0.4.5] - 2020-07-08
|
||||
|
||||
- No changes here, just an uptick for Crates.io using the wrong Cargo.lock.
|
||||
|
|
16
src/app.rs
16
src/app.rs
|
@ -130,6 +130,13 @@ impl App {
|
|||
self.data_collection.reset();
|
||||
}
|
||||
|
||||
fn close_dd(&mut self) {
|
||||
self.delete_dialog_state.is_showing_dd = false;
|
||||
self.delete_dialog_state.is_on_yes = false;
|
||||
self.to_delete_process_list = None;
|
||||
self.dd_err = None;
|
||||
}
|
||||
|
||||
pub fn on_esc(&mut self) {
|
||||
self.reset_multi_tap_keys();
|
||||
if self.is_in_dialog() {
|
||||
|
@ -137,10 +144,7 @@ impl App {
|
|||
self.help_dialog_state.is_showing_help = false;
|
||||
self.help_dialog_state.scroll_state.current_scroll_index = 0;
|
||||
} else {
|
||||
self.delete_dialog_state.is_showing_dd = false;
|
||||
self.delete_dialog_state.is_on_yes = false;
|
||||
self.to_delete_process_list = None;
|
||||
self.dd_err = None;
|
||||
self.close_dd();
|
||||
}
|
||||
|
||||
self.is_force_redraw = true;
|
||||
|
@ -390,7 +394,9 @@ impl App {
|
|||
/// One of two functions allowed to run while in a dialog...
|
||||
pub fn on_enter(&mut self) {
|
||||
if self.delete_dialog_state.is_showing_dd {
|
||||
if self.delete_dialog_state.is_on_yes {
|
||||
if self.dd_err.is_some() {
|
||||
self.close_dd();
|
||||
} else if self.delete_dialog_state.is_on_yes {
|
||||
// If within dd...
|
||||
if self.dd_err.is_none() {
|
||||
// Also ensure that we didn't just fail a dd...
|
||||
|
|
Loading…
Reference in a new issue