Skip to content

Commit

Permalink
video: Do not warn about no allowed IPs on wireless connections
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaellehmkuhl authored and ArturoManzoli committed Aug 15, 2024
1 parent e8eaaf8 commit 10014e5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/stores/video.ts
Original file line number Diff line number Diff line change
Expand Up @@ -765,13 +765,17 @@ export const useVideoStore = defineStore('video', () => {
// about them from BlueOS. If that fails, send a warning an clear the check routine.
if (allowedIceIps.value.isEmpty() && availableIceIps.value.length >= 1) {
// Try to select the IP automatically if it's a wired connection (based on BlueOS data).
let currentlyOnWirelessConnection = false
try {
const ipsInfo = await getIpsInformationFromVehicle(globalAddress)
const newAllowedIps: string[] = []
ipsInfo.forEach((ipInfo) => {
const isIceIp = availableIceIps.value.includes(ipInfo.ipv4Address)
const alreadyAllowedIp = [...allowedIceIps.value, ...newAllowedIps].includes(ipInfo.ipv4Address)
const theteredInterfaceTypes = ['WIRED', 'USB']
if (globalAddress === ipInfo.ipv4Address && !theteredInterfaceTypes.includes(ipInfo.interfaceType)) {
currentlyOnWirelessConnection = true
}
if (!theteredInterfaceTypes.includes(ipInfo.interfaceType) || alreadyAllowedIp || !isIceIp) return
console.info(`Adding the wired address '${ipInfo.ipv4Address}' to the list of allowed ICE IPs.`)
newAllowedIps.push(ipInfo.ipv4Address)
Expand All @@ -790,7 +794,7 @@ export const useVideoStore = defineStore('video', () => {

// If the system was still not able to populate the allowed IPs list yet, warn the user.
// Otherwise, clear the check routine.
if (allowedIceIps.value.isEmpty() && !noIpSelectedWarningIssued) {
if (allowedIceIps.value.isEmpty() && !noIpSelectedWarningIssued && !currentlyOnWirelessConnection) {
console.info('No ICE IPs selected for the allowed list. Warning user.')
issueNoIpSelectedWarning()
noIpSelectedWarningIssued = true
Expand Down

0 comments on commit 10014e5

Please sign in to comment.