fix history

pull/6/head
dvkt 5 years ago
parent cc9036b5ce
commit b7f4131de5

@ -58,9 +58,8 @@ pub fn as_raw_menu() -> String {
// save a single history entry if the history file exists
pub fn save(label: &str, url: &str) -> Result<()> {
let file = format!("{}{}", config::DIR, HISTORY_FILE);
if !std::path::Path::new(&file).exists() {
return Err(error!("History file doesn't exist: {}", file));
if let Err(e) = config::path() {
return Err(error!("History file doesn't exist: {}", e));
}
config::append(HISTORY_FILE, label, url)

@ -486,7 +486,7 @@ impl Menu {
if host != "help" {
let hurl = url.to_string();
let hname = line.name.clone();
thread::spawn(move || history::save(&hurl, &hname));
thread::spawn(move || history::save(&hname, &hurl));
Action::Open(url)
} else {
Action::None

Loading…
Cancel
Save