Skip to content

Commit 4b04614

Browse files
Few minor fixups.[CPP-785][CPP-786] (#629)
* Remove firmware file scan on startup. * Add settings refresh when new sbp/sbp.json file begins recording.
1 parent 8d83514 commit 4b04614

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

console_backend/src/main_tab.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ impl MainTab {
163163
self.shared_state
164164
.set_sbp_logging(true, self.client_sender.clone());
165165
self.shared_state.set_sbp_logging_filepath(Some(filepath));
166+
self.shared_state.set_settings_refresh(true);
166167
}
167168
self.shared_state.set_sbp_logging_format(logging);
168169
}

console_backend/src/update_tab.rs

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,9 @@ pub fn update_tab_thread(
9898
msg_sender: MsgSender,
9999
) {
100100
let is_running = ArcBool::new_with(true);
101+
let mut app_started = false;
101102
thread::scope(|scope| {
102-
scope.spawn(|_| wait_for_device_settings(is_running.clone(), sender.clone(), update_tab_context.clone(), shared_state.clone()));
103+
scope.spawn(|_| wait_for_device_settings(is_running.clone(), update_tab_context.clone(), shared_state.clone()));
103104
scope
104105
.spawn(|inner_scope| {
105106
sender.send(Some(UpdateTabUpdate::new())).unwrap();
@@ -113,8 +114,10 @@ pub fn update_tab_thread(
113114
// Check for path updates.
114115
if let Some(fw_dir) = update.firmware_directory {
115116
update_tab_context.set_firmware_directory(fw_dir.clone());
116-
update_tab_context
117-
.set_firmware_local_filepath(check_for_firmware_local_filepath(fw_dir));
117+
if app_started {
118+
update_tab_context.set_firmware_local_filepath(check_for_firmware_local_filepath(fw_dir));
119+
}
120+
app_started = true;
118121
}
119122
if let Some(fw_local_filepath) = update.firmware_local_filepath {
120123
if let Some(parent_path) = fw_local_filepath.parent() {
@@ -184,7 +187,6 @@ pub fn update_tab_thread(
184187

185188
fn wait_for_device_settings(
186189
is_running: ArcBool,
187-
sender: Sender<Option<UpdateTabUpdate>>,
188190
update_tab_context: UpdateTabContext,
189191
shared_state: SharedState,
190192
) -> Result<()> {
@@ -193,11 +195,7 @@ fn wait_for_device_settings(
193195
update_tab_context.set_current_firmware_version(firmware_version);
194196
check_console_outdated(update_tab_context.clone())?;
195197
check_firmware_outdated(update_tab_context.clone())?;
196-
check_above_v2(update_tab_context.clone())?;
197-
sender.send(Some(UpdateTabUpdate {
198-
firmware_directory: Some(update_tab_context.firmware_directory()),
199-
..Default::default()
200-
}))?;
198+
check_above_v2(update_tab_context)?;
201199
break;
202200
}
203201
std::thread::sleep(Duration::from_millis(WAIT_FOR_SETTINGS_THREAD_SLEEP_MS));

0 commit comments

Comments
 (0)