fix #289: crash on sample dir `Add` button press
This commit is contained in:
parent
0f019b6fb3
commit
02ac1a5570
|
@ -13,8 +13,11 @@ even on minor releases, e.g. `0.7.5` -> `0.7.6`.
|
|||
|
||||
## unreleased
|
||||
|
||||
* fix [#289](https://github.com/scottlamb/moonfire-nvr/issues/289): crash on
|
||||
pressing the `Add` button in the sample file directory dialog
|
||||
* log to `stderr` again, fixing a regression with the `tracing` change in 0.7.6.
|
||||
|
||||
|
||||
## 0.7.6 (2023-07-08)
|
||||
|
||||
* new log formats using `tracing`. This will allow richer context information.
|
||||
|
|
|
@ -266,7 +266,7 @@ fn add_dir_dialog(db: &Arc<db::Database>, siv: &mut Cursive) {
|
|||
let db = db.clone();
|
||||
move |siv| {
|
||||
let path = siv
|
||||
.find_name::<views::EditView>("path")
|
||||
.find_name::<TabCompleteEditView>("path")
|
||||
.unwrap()
|
||||
.get_content();
|
||||
add_dir(&db, siv, path.as_ref().as_ref())
|
||||
|
|
|
@ -32,6 +32,10 @@ impl TabCompleteEditView {
|
|||
self.tab_completer = Some(Rc::new(handler));
|
||||
self
|
||||
}
|
||||
|
||||
pub fn get_content(&self) -> Rc<String> {
|
||||
self.edit_view.borrow_mut().get_content()
|
||||
}
|
||||
}
|
||||
|
||||
impl View for TabCompleteEditView {
|
||||
|
|
Loading…
Reference in New Issue