mirror of
https://github.com/noctalia-dev/noctalia-shell.git
synced 2026-05-11 17:08:27 +08:00
Merge pull request #1422 from notiant/patch-11
NetworkService: fix logic of resetting connectivityCheckProcess.failedChecks
This commit is contained in:
@@ -870,32 +870,23 @@ Singleton {
|
||||
if (!result) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (result === "none" && root.networkConnectivity !== result) {
|
||||
root.networkConnectivity = result;
|
||||
connectivityCheckProcess.failedChecks = 0;
|
||||
root.scan();
|
||||
if (result === "full" || result === "none" || result === "unknown") {
|
||||
if (connectivityCheckProcess.failedChecks !== 0) {
|
||||
connectivityCheckProcess.failedChecks = 0;
|
||||
}
|
||||
if (result !== root.networkConnectivity) {
|
||||
root.networkConnectivity = result;
|
||||
root.scan();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (result === "full" && root.networkConnectivity !== result) {
|
||||
root.networkConnectivity = result;
|
||||
root.internetConnectivity = true;
|
||||
connectivityCheckProcess.failedChecks = 0;
|
||||
root.scan();
|
||||
}
|
||||
|
||||
if ((result === "limited" || result === "portal") && root.networkConnectivity !== result) {
|
||||
if ((result === "limited" || result === "portal") && result !== root.networkConnectivity) {
|
||||
connectivityCheckProcess.failedChecks++;
|
||||
if (connectivityCheckProcess.failedChecks === 3) {
|
||||
root.networkConnectivity = result;
|
||||
pingCheckProcess.running = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (result === "unknown" && root.networkConnectivity !== result) {
|
||||
root.networkConnectivity = result;
|
||||
connectivityCheckProcess.failedChecks = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user