ConfigClient is an option no more; config client degraded mode

This commit is contained in:
veeso
2021-07-08 15:07:24 +02:00
parent b9cb961da6
commit e6b44e1461
12 changed files with 350 additions and 310 deletions

View File

@@ -103,10 +103,7 @@ impl FileTransferActivity {
///
/// Set text editor to use
pub(super) fn setup_text_editor(&self) {
if let Some(config_cli) = self.context.as_ref().unwrap().config_client.as_ref() {
// Set text editor
env::set_var("EDITOR", config_cli.get_text_editor());
}
env::set_var("EDITOR", self.config().get_text_editor());
}
/// ### read_input_event

View File

@@ -210,6 +210,13 @@ impl FileTransferActivity {
})
}
/// ### config
///
/// Returns config client reference
fn config(&self) -> &ConfigClient {
&self.context.as_ref().unwrap().config_client
}
/// ### theme
///
/// Get a reference to `Theme`
@@ -249,7 +256,7 @@ impl Activity for FileTransferActivity {
self.init();
debug!("Initialized view");
// Verify error state from context
if let Some(err) = self.context.as_mut().unwrap().get_error() {
if let Some(err) = self.context.as_mut().unwrap().error() {
error!("Fatal error on create: {}", err);
self.mount_fatal(&err);
}