pub fn reset_file() {
    p!("(f) Remake File | (s) Reset Settings");
    let ans = ask_string("Choice", "", true);

    if ans == "f" {
        p!("This will delete all the notes.");
        p!("And remake the file with a new password.");

        if ask_bool("Are you sure?", true) {
            fs::remove_file(get_file_path()).unwrap();
            if !create_file() {
                exit()
            }
            reset_state(get_notes(true));
        }
    } else if ans == "s" {
        p!("This will restore all settings to defaults.");
        p!("E.g: page_size, row_space, color_1");

        if ask_bool("Are you sure?", true) {
            reset_settings();
            update_header();
            create_menus();
        }
    }
}
// Asks the user if it wants to remake the file
// Or just reset the settings to default
// Then does it if response was positive
// Variables are then updated to reflect change
Asks the user if it wants to remake the file
Or just reset the settings to default
Then does it if response was positive
Variables are then updated to reflect change
Asks the user if it wants to remake the file Or just reset the settings to default Then does it if response was positive Variables are then updated to reflect change
pub fn reset_file() {
    p!("(f) Remake File | (s) Reset Settings");
    let ans = ask_string("Choice", "", true);
    if ans == "f" {
        p!("This will delete all the notes.");
        p!("And remake the file with a new password.");
        if ask_bool("Are you sure?", true) {
            fs::remove_file(get_file_path()).unwrap();
            if !create_file() {
                exit()
            }
            reset_state(get_notes(true));
        }
    } else if ans == "s" {
        p!("This will restore all settings to defaults.");
        p!("E.g: page_size, row_space, color_1");
        if ask_bool("Are you sure?", true) {
            reset_settings();
            update_header();
            create_menus();
        }
    }
}
pub fn reset_file ( ) { p ! ( " " ) ; let ans = ask_string ( " " , " " , true ) ; if ans == " " { p ! ( " " ) ; p ! ( " " ) ; if ask_bool ( " " , true ) { fs :: remove_file ( get_file_path ( ) ) . unwrap ( ) ; if ! create_file ( ) { exit ( ) } reset_state ( get_notes ( true ) ) ; } } else if ans == " " { p ! ( " " ) ; p ! ( " " ) ; if ask_bool ( " " , true ) { reset_settings ( ) ; update_header ( ) ; create_menus ( ) ; } } }
Asks the user if it wants to remake the file
Or just reset the settings to default
Then does it if response was positive
Variables are then updated to reflect change
Asks the user if it wants to remake the file Or just reset the settings to default Then does it if response was positive Variables are then updated to reflect change