Skip to content

Commit

Permalink
Check APP_STATE to ensure proper dvr configuration.
Browse files Browse the repository at this point in the history
  • Loading branch information
SumolX committed Aug 27, 2024
1 parent 30a18a8 commit ded1956
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/ui/page_wifi.c
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,9 @@ static void page_wifi_mask_password(lv_obj_t *obj, int size) {

/**
* Update settings and apply them.
*
* Note: This function will be invoked asynchronously post bootup and may
* require additional APP_STATE checks to ensure integrity of execution.
*/
static void page_wifi_update_settings() {
g_setting.wifi.enable = btn_group_get_sel(&page_wifi.page_1.enable.button) == 0;
Expand Down Expand Up @@ -304,7 +307,9 @@ static void page_wifi_update_settings() {

// Activate WiFi interface
if (g_setting.wifi.enable) {
dvr_update_vi_conf(VR_1080P30);
if (g_app_state == APP_STATE_MAINMENU) {
dvr_update_vi_conf(VR_1080P30);
}
if (WIFI_MODE_AP == g_setting.wifi.mode) {
system_script(WIFI_AP_ON);
} else {
Expand Down Expand Up @@ -728,11 +733,6 @@ static lv_obj_t *page_wifi_create(lv_obj_t *parent, panel_arr_t *arr) {
page_wifi_sync_settings();
page_wifi_update_current_page(0);

// Update DVR Resolution
if (g_setting.wifi.enable) {
dvr_update_vi_conf(VR_1080P30);
}

return page;
}

Expand Down

0 comments on commit ded1956

Please sign in to comment.