Skip to content

Commit 5d8f5f6

Browse files
joaomariolagopatrickelectric
authored andcommitted
frontend: Beacon: Add double check for is Wifi
* Add a double check when detecting if its connected using WiFi to avoid cases where its pointing using WiFi connection but is actually using Cable
1 parent 974b95d commit 5d8f5f6

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

core/frontend/src/components/beacon/BeaconTrayMenu.vue

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,19 @@ export default Vue.extend({
7373
return beacon.available_domains.filter((entry) => entry.interface_type === InterfaceType.WIRED)
7474
},
7575
wireless_interface_domains(): Domain[] {
76-
return beacon.available_domains.filter((entry) => entry.interface_type !== InterfaceType.WIRED)
76+
return beacon.available_domains.filter(
77+
(entry) => entry.interface_type === InterfaceType.WIFI || entry.interface_type === InterfaceType.HOTSPOT,
78+
)
7779
},
7880
is_connected_to_wifi(): boolean {
79-
return this.wireless_interface_domains.some((domain) => domain.ip === beacon.nginx_ip_address)
81+
const is_on_wifi = this.wireless_interface_domains.some((domain) => domain.ip === beacon.nginx_ip_address)
82+
const is_on_wired = this.wired_interface_domains.some((domain) => domain.ip === beacon.nginx_ip_address)
83+
84+
if (is_on_wifi && is_on_wired) {
85+
console.debug('Unexpected behavior. There are both Wired and Wireless interfaces sharing the same IP address.')
86+
}
87+
88+
return is_on_wifi && !is_on_wired
8089
},
8190
},
8291
mounted() {

0 commit comments

Comments
 (0)