🛜 Simplify wifi services

This commit is contained in:
Rune Harlyk
2024-09-03 20:47:07 +02:00
committed by Rune Harlyk
parent e69e48533f
commit 8ac2fad1b1
2 changed files with 5 additions and 5 deletions
+2 -2
View File
@@ -33,7 +33,6 @@
async function scanNetworks() {
scanActive = true;
await api.get('/api/scanNetworks');
if ((await pollingResults()) == false) {
pollingId = setInterval(() => pollingResults(), 1000);
}
@@ -41,8 +40,9 @@
}
async function pollingResults() {
const result = await api.get<NetworkList>('/api/listNetworks');
if (result.isErr()){
await api.get('/api/wifi/scan');
const result = await api.get<NetworkList>('/api/wifi/networks');
console.error(`Error occurred while fetching: `, result.inner);
return false
}