Skip to content

Commit

Permalink
check wifi enabled earlier (#442)
Browse files Browse the repository at this point in the history
  • Loading branch information
agriffis authored Jun 20, 2024
1 parent 0da9dcb commit 646d5ad
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/service/network.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,11 @@ export class Wifi extends Service {
[0, 'none'],
];

// Check if wifi is enabled first, since internet might be provided by
// a wired network.
if (!this.enabled)
return 'network-wireless-offline-symbolic';

if (this.internet === 'connected') {
for (const [threshold, name] of iconNames) {
if (this.strength >= threshold)
Expand All @@ -202,9 +207,6 @@ export class Wifi extends Service {
if (this.internet === 'connecting')
return 'network-wireless-acquiring-symbolic';

if (this.enabled)
return 'network-wireless-offline-symbolic';

return 'network-wireless-disabled-symbolic';
}
}
Expand Down

0 comments on commit 646d5ad

Please sign in to comment.