diff --git a/src/stores/mainVehicle.ts b/src/stores/mainVehicle.ts index c0f061f24..cf8b72b43 100644 --- a/src/stores/mainVehicle.ts +++ b/src/stores/mainVehicle.ts @@ -75,7 +75,10 @@ export const useMainVehicleStore = defineStore('main-vehicle', () => { data: defaultWebRTCSignallingURI.value, enabled: false, } as CustomParameter) - const customWebRTCConfiguration = useStorage('cockpit-rtc-config', defaultRtcConfiguration) + const customWebRTCConfiguration = useStorage('cockpit-custom-rtc-config', { + data: defaultRtcConfiguration, + enabled: false, + }) const lastHeartbeat = ref() const firmwareType = ref() @@ -133,7 +136,7 @@ export const useMainVehicleStore = defineStore('main-vehicle', () => { } } console.log('Using WebRTC configuration from storage.') - return customWebRTCConfiguration.value + return customWebRTCConfiguration.value.enabled ? customWebRTCConfiguration.value.data : defaultRtcConfiguration }) /** diff --git a/src/views/ConfigurationGeneralView.vue b/src/views/ConfigurationGeneralView.vue index b548de7d4..bb2a32880 100644 --- a/src/views/ConfigurationGeneralView.vue +++ b/src/views/ConfigurationGeneralView.vue @@ -137,13 +137,21 @@ /> Current address: {{ mainVehicleStore.webRTCSignallingURI.toString() }}
-
+
Custom RTC configuration: -
+
+ { return true } -const customRtcConfiguration = ref(JSON.stringify(mainVehicleStore.customWebRTCConfiguration, null, 4)) +const customRtcConfiguration = ref(JSON.stringify(mainVehicleStore.customWebRTCConfiguration.data, null, 4)) const updateWebRtcConfiguration = (): void => { try { const newConfig = JSON.parse(customRtcConfiguration.value) - mainVehicleStore.customWebRTCConfiguration = newConfig + mainVehicleStore.customWebRTCConfiguration.data = newConfig location.reload() } catch (error) { alert(`Could not update WebRTC configuration. ${error}.`)