add reset wifi to boot button

This commit is contained in:
Terrence
2025-01-07 22:52:52 +08:00
parent b3dd2461d2
commit a8bceee3c7
2 changed files with 10 additions and 2 deletions

View File

@@ -136,7 +136,11 @@ private:
void InitializeButtons() { void InitializeButtons() {
boot_button_.OnClick([this]() { boot_button_.OnClick([this]() {
Application::GetInstance().ToggleChatState(); auto& app = Application::GetInstance();
if (app.GetDeviceState() == kDeviceStateStarting && !WifiStation::GetInstance().IsConnected()) {
ResetWifiConfiguration();
}
app.ToggleChatState();
}); });
} }

View File

@@ -244,7 +244,11 @@ private:
void InitializeButtons() { void InitializeButtons() {
boot_button_.OnClick([this]() { boot_button_.OnClick([this]() {
Application::GetInstance().ToggleChatState(); auto& app = Application::GetInstance();
if (app.GetDeviceState() == kDeviceStateStarting && !WifiStation::GetInstance().IsConnected()) {
ResetWifiConfiguration();
}
app.ToggleChatState();
}); });
} }