added reset functionality
This commit is contained in:
@@ -61,3 +61,6 @@ All application data is stored in:
|
||||
* (d on an item in the queue): Remove item from queue.
|
||||
* X: Deletes the local file if the file exists.
|
||||
* o: Enter offline playback/Attempt to ping the server to join online mode. (Local downloaded database is available during this mode)
|
||||
|
||||
##### Admin Controls
|
||||
* /\reset"Enter": Deletes the config file and exits the program. Reloading will prompt URL, Username, and Password Input.
|
||||
@@ -484,6 +484,15 @@ fn handle_key(app: &mut App, code: KeyCode) {
|
||||
KeyCode::Backspace => { search.input.pop(); return; }
|
||||
KeyCode::Enter => {
|
||||
let term = search.input.trim().to_string();
|
||||
// Special command: reset config + exit
|
||||
if term == r"\reset" {
|
||||
if let Some(path) = crate::core::config::config_path() {
|
||||
let _ = std::fs::remove_file(&path);
|
||||
}
|
||||
app.should_exit = true;
|
||||
return;
|
||||
}
|
||||
|
||||
if term.is_empty() {
|
||||
app.search = None;
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user