Change accel subscription logic
This commit is contained in:
+2
-5
@@ -260,10 +260,9 @@ static void apply_settings(bool first_run) {
|
||||
// changes to low fuel threshold
|
||||
batt_callback(battery_state_service_peek());
|
||||
|
||||
// sub/unsub from accelerometer if needed
|
||||
if (settings.DateTimeoutSecs == 0) {
|
||||
// re-sub accelerometer
|
||||
accel_tap_service_unsubscribe();
|
||||
} else {
|
||||
if (settings.DateTimeoutSecs != 0) {
|
||||
accel_tap_service_subscribe(accel_tap_handler);
|
||||
}
|
||||
}
|
||||
@@ -305,9 +304,7 @@ static void main_window_load() {
|
||||
}
|
||||
|
||||
static void main_window_unload() {
|
||||
if (settings.DateTimeoutSecs != 0) {
|
||||
accel_tap_service_unsubscribe();
|
||||
}
|
||||
layer_destroy(s_fuel_mg_layer);
|
||||
layer_destroy(s_temp_mg_layer);
|
||||
bitmap_layer_destroy(s_f_layer);
|
||||
|
||||
Reference in New Issue
Block a user