A fork of https://github.com/crosspoint-reader/crosspoint-reader
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

chore: remove rendundant xTaskCreate (#1264)

## Summary

Ref discussion:
https://github.com/crosspoint-reader/crosspoint-reader/pull/1222#discussion_r2865402110

Important note that this is a bug-for-bug fix. In reality, this branch
`WiFi.status() == WL_CONNECTED` is pretty much a dead code because the
entry point of these 2 activities don't use wifi.

It is better to refactor the management of network though, but it's
better to be a dedicated PR.

---

### AI Usage

While CrossPoint doesn't have restrictions on AI tools in contributing,
please be transparent about their usage as it
helps set the right context for reviewers.

Did you use AI tools to help write this code? **NO**

authored by

Xuan-Son Nguyen and committed by
GitHub
307a6608 a3504925

+2 -34
+1 -19
src/activities/reader/KOReaderSyncActivity.cpp
··· 204 204 // Check if already connected (e.g. from settings page auth) 205 205 if (WiFi.status() == WL_CONNECTED) { 206 206 LOG_DBG("KOSync", "Already connected to WiFi"); 207 - state = SYNCING; 208 - statusMessage = tr(STR_SYNCING_TIME); 209 - requestUpdate(true); 210 - 211 - // Perform sync directly (will be handled in loop) 212 - xTaskCreate( 213 - [](void* param) { 214 - auto* self = static_cast<KOReaderSyncActivity*>(param); 215 - // Sync time first 216 - syncTimeWithNTP(); 217 - { 218 - RenderLock lock(*self); 219 - self->statusMessage = tr(STR_CALC_HASH); 220 - } 221 - self->requestUpdate(true); 222 - self->performSync(); 223 - vTaskDelete(nullptr); 224 - }, 225 - "SyncTask", 4096, this, 1, nullptr); 207 + onWifiSelectionComplete(true); 226 208 return; 227 209 } 228 210
+1 -15
src/activities/settings/KOReaderAuthActivity.cpp
··· 51 51 void KOReaderAuthActivity::onEnter() { 52 52 Activity::onEnter(); 53 53 54 - // Turn on WiFi 55 - WiFi.mode(WIFI_STA); 56 - 57 54 // Check if already connected 58 55 if (WiFi.status() == WL_CONNECTED) { 59 - state = AUTHENTICATING; 60 - statusMessage = tr(STR_AUTHENTICATING); 61 - requestUpdate(); 62 - 63 - // Perform authentication in a separate task 64 - xTaskCreate( 65 - [](void* param) { 66 - auto* self = static_cast<KOReaderAuthActivity*>(param); 67 - self->performAuthentication(); 68 - vTaskDelete(nullptr); 69 - }, 70 - "AuthTask", 4096, this, 1, nullptr); 56 + onWifiSelectionComplete(true); 71 57 return; 72 58 } 73 59