Skip to content

fix: DFS confirmation dialog shows incorrectly when saving other advanced WiFi settings #1004

Description

@AustinChangLinksys

Related Issue

linksys/LinksysWRT#399

Problem

In WiFi Advanced Settings page, the DFS confirmation dialog appears whenever the user saves any setting change, as long as DFS is already enabled. This is confusing when the user only changed IPTV or other settings.

Root Cause

wifi_advanced_settings_view.dart line 72 checks:

if (ref.read(wifiAdvancedProvider).isDFSEnabled == true) {
  _showConfirmDFSModal()...
}

This checks the current state of DFS, not whether DFS was changed from off to on. So if DFS is already enabled, every save action shows the DFS confirmation dialog.

Expected Behavior

The DFS confirmation dialog should only appear when the user is turning DFS ON (changing from disabled to enabled), not when DFS is already enabled and the user is changing other settings.

Fix

Compare _preservedState (original state) with current state:

final isDFSBeingEnabled = _preservedState?.isDFSEnabled != true && 
                          currentState.isDFSEnabled == true;
if (isDFSBeingEnabled) {
  _showConfirmDFSModal()...
}

Steps to Reproduce

  1. Go to WiFi Advanced Settings
  2. Have DFS already enabled (or enable it and save)
  3. Toggle IPTV on
  4. Click Save
  5. Actual: DFS confirmation dialog appears
  6. Expected: Save should proceed without DFS dialog (since DFS wasn't changed)

Metadata

Metadata

Labels

1.xLabeled for 1.x version

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions