Skip to content

Commit

Permalink
Merge 20841d5 into eb0a896
Browse files Browse the repository at this point in the history
  • Loading branch information
Eliot00 committed Dec 23, 2021
2 parents eb0a896 + 20841d5 commit 8298ce2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
10 changes: 9 additions & 1 deletion quake_tui/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ use std::error::Error;
use std::path::PathBuf;

use crossterm::event::{self, Event, KeyCode};
use quake_core::entry::entry_paths::EntryPaths;
use quake_core::usecases::entry_usecases;
use quake_core::QuakeConfig;
use tui::backend::Backend;
Expand Down Expand Up @@ -44,7 +45,14 @@ impl App {
fields.insert("content".to_string(), content.clone());
let type_path = PathBuf::from(&self.config.workspace).join(entry_type);
match entry_usecases::update_entry_properties(type_path, entry_type, *id, &fields) {
Ok(_) => self.send_message("saved!"),
Ok(_) => {
entry_usecases::sync_in_path(&EntryPaths::init(
&self.config.workspace,
entry_type,
))
.unwrap();
self.send_message("saved!")
}
Err(_) => self.send_message("save failed!"),
}
}
Expand Down
2 changes: 1 addition & 1 deletion quake_tui/src/widgets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ impl Widget for MainWidget {
}
MainWidget::Editor { content, .. } => {
let editor = Paragraph::new(content.as_ref())
.block(Block::default().borders(Borders::ALL).title("Editro"));
.block(Block::default().borders(Borders::ALL).title("Editor"));
editor.render(area, buf);
}
}
Expand Down

0 comments on commit 8298ce2

Please sign in to comment.