Skip to content

Commit

Permalink
Revert "Check if a Config message was handled before creating first tab"
Browse files Browse the repository at this point in the history
This reverts commit 7b152bd.
  • Loading branch information
jackpot51 committed Jan 2, 2024
1 parent 7b152bd commit 1e0ce2b
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,6 @@ pub struct App {
context_page: ContextPage,
term_event_tx_opt: Option<mpsc::Sender<(segmented_button::Entity, TermEvent)>>,
term_config: TermConfig,
config_subscribed: bool,
}

impl App {
Expand Down Expand Up @@ -385,7 +384,6 @@ impl Application for App {
context_page: ContextPage::Settings,
term_config: flags.term_config,
term_event_tx_opt: None,
config_subscribed: false,
};

let command = app.update_title();
Expand All @@ -407,7 +405,6 @@ impl Application for App {
self.config = config;
return self.update_config();
}
self.config_subscribed = true;
}
Message::Copy(entity_opt) => {
let entity = entity_opt.unwrap_or_else(|| self.tab_model.active());
Expand Down Expand Up @@ -547,9 +544,8 @@ impl Application for App {
_ => {}
}
}
Message::TabNew => match (self.config_subscribed, &self.term_event_tx_opt) {
(false, _) => log::info!("must wait for config subscription before creating first tab"),
(true, Some(term_event_tx)) => match self.themes.get(self.config.syntax_theme()) {
Message::TabNew => match &self.term_event_tx_opt {
Some(term_event_tx) => match self.themes.get(self.config.syntax_theme()) {
Some(colors) => {
let entity = self
.tab_model
Expand All @@ -576,7 +572,7 @@ impl Application for App {
//TODO: fall back to known good theme
}
},
(true, None) => {
None => {
log::warn!("tried to create new tab before having event channel");
}
},
Expand Down

0 comments on commit 1e0ce2b

Please sign in to comment.