Change accel subscription logic

This commit is contained in:
2026-06-01 23:34:46 -04:00
parent 152823fd99
commit 5748ee636f
+4 -7
View File
@@ -260,10 +260,9 @@ static void apply_settings(bool first_run) {
// changes to low fuel threshold // changes to low fuel threshold
batt_callback(battery_state_service_peek()); batt_callback(battery_state_service_peek());
// sub/unsub from accelerometer if needed // re-sub accelerometer
if (settings.DateTimeoutSecs == 0) { accel_tap_service_unsubscribe();
accel_tap_service_unsubscribe(); if (settings.DateTimeoutSecs != 0) {
} else {
accel_tap_service_subscribe(accel_tap_handler); accel_tap_service_subscribe(accel_tap_handler);
} }
} }
@@ -305,9 +304,7 @@ static void main_window_load() {
} }
static void main_window_unload() { static void main_window_unload() {
if (settings.DateTimeoutSecs != 0) { accel_tap_service_unsubscribe();
accel_tap_service_unsubscribe();
}
layer_destroy(s_fuel_mg_layer); layer_destroy(s_fuel_mg_layer);
layer_destroy(s_temp_mg_layer); layer_destroy(s_temp_mg_layer);
bitmap_layer_destroy(s_f_layer); bitmap_layer_destroy(s_f_layer);