Skip to content

Commit

Permalink
Added missing initiation of no_time_restore in settings (also renamed…
Browse files Browse the repository at this point in the history
… settings.noTimeRestore to use snakecase instead)
  • Loading branch information
stianKristensen committed Nov 24, 2024
1 parent c32e568 commit 1b9d112
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/common/system/settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ typedef struct settings_s {
int blue_light_rgb;
char blue_light_time[16];
char blue_light_time_off[16];
bool no_time_restore;

char mainui_button_x[JSON_STRING_LEN];
char mainui_button_y[JSON_STRING_LEN];
Expand Down Expand Up @@ -103,6 +104,7 @@ static settings_s __default_settings = (settings_s){
.vibration = 2,
.startup_tab = 0,
.startup_application = 0,
.no_time_restore = false,
// Menu button actions
.mainui_single_press = 1,
.mainui_long_press = 0,
Expand Down Expand Up @@ -206,7 +208,7 @@ void settings_load(void)
settings.blue_light_schedule = config_flag_get(".blf");
settings.rec_indicator = config_flag_get(".recIndicator");
settings.rec_hotkey = config_flag_get(".recHotkey");
settings.noTimeRestore = config_flag_get(".noTimeRestore");
settings.no_time_restore = config_flag_get(".noTimeRestore");

if (config_flag_get(".noLowBatteryAutoSave")) // flag is deprecated, but keep compatibility
settings.low_battery_autosave_at = 0;
Expand Down
4 changes: 2 additions & 2 deletions src/tweaks/menus.h
Original file line number Diff line number Diff line change
Expand Up @@ -481,8 +481,8 @@ void menu_themeOverrides(void *_)

void menu_blueLight(void *_)
{
bool schedule_show = (DEVICE_ID == MIYOO354 || settings.noTimeRestore || settings.blue_light_schedule);
bool schedule_disable = (!settings.noTimeRestore && !network_state.ntp && !settings.blue_light_schedule);
bool schedule_show = (DEVICE_ID == MIYOO354 || settings.no_time_restore || settings.blue_light_schedule);
bool schedule_disable = (!settings.no_time_restore && !network_state.ntp && !settings.blue_light_schedule);
if (!_menu_user_blue_light._created) {
network_loadState();
_menu_user_blue_light = list_createWithTitle(6, LIST_SMALL, "Blue light filter");
Expand Down

0 comments on commit 1b9d112

Please sign in to comment.