Skip to content

Commit

Permalink
main-vehicle: Get query parameter settings back
Browse files Browse the repository at this point in the history
It was mistakenly removed on a recent commit.
  • Loading branch information
rafaellehmkuhl authored and ArturoManzoli committed Jun 18, 2024
1 parent 40f5672 commit 2419431
Showing 1 changed file with 11 additions and 15 deletions.
26 changes: 11 additions & 15 deletions src/stores/mainVehicle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,21 +101,17 @@ export const useMainVehicleStore = defineStore('main-vehicle', () => {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const modes = ref<Map<string, any>>()

const mainConnectionURI = computed(
() =>
new Connection.URI(
customMainConnectionURI.value.enabled ? customMainConnectionURI.value.data : defaultMainConnectionURI.value
)
)

const webRTCSignallingURI = computed(
() =>
new Connection.URI(
customWebRTCSignallingURI.value.enabled
? customWebRTCSignallingURI.value.data
: defaultWebRTCSignallingURI.value
)
)
const mainConnectionURI = computed(() => {
const queryURI = new URLSearchParams(window.location.search).get('mainConnectionURI')
const customURI = customMainConnectionURI.value.enabled ? customMainConnectionURI.value.data : undefined
return new Connection.URI(queryURI ?? customURI ?? defaultMainConnectionURI.value)
})

const webRTCSignallingURI = computed(() => {
const queryWebRTCSignallingURI = new URLSearchParams(window.location.search).get('webRTCSignallingURI')
const customURI = customWebRTCSignallingURI.value.enabled ? customWebRTCSignallingURI.value.data : undefined
return new Connection.URI(queryWebRTCSignallingURI ?? customURI ?? defaultWebRTCSignallingURI.value)
})

/**
* Check if vehicle is online (no more than 5 seconds passed since last heartbeat)
Expand Down

0 comments on commit 2419431

Please sign in to comment.