Skip to content

Commit

Permalink
settings-sync: Remove view index and global address from auto sync
Browse files Browse the repository at this point in the history
The global address does not make sense to sync, since when the user is connected, changing the address can only disconnect it.

The widgets profile and view index also does not make much sense since it may be something the user is messing around with before connection and will receive a conflict unnecessarily. Those are not trully settings, but states that we want to keep between sessions.
  • Loading branch information
rafaellehmkuhl authored and ArturoManzoli committed Jul 16, 2024
1 parent 496079f commit 8305394
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/stores/mainVehicle.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useTimestamp, watchThrottled } from '@vueuse/core'
import { useStorage, useTimestamp, watchThrottled } from '@vueuse/core'
import { defineStore } from 'pinia'
import { computed, reactive, ref, watch } from 'vue'

Expand Down Expand Up @@ -64,7 +64,7 @@ export const useMainVehicleStore = defineStore('main-vehicle', () => {
const ws_protocol = location?.protocol === 'https:' ? 'wss' : 'ws'

const cpuLoad = ref<number>()
const globalAddress = useBlueOsStorage('cockpit-vehicle-address', defaultGlobalAddress)
const globalAddress = useStorage('cockpit-vehicle-address', defaultGlobalAddress)

const defaultMainConnectionURI = ref<string>(`${ws_protocol}://${globalAddress.value}/mavlink2rest/ws/mavlink`)
const defaultWebRTCSignallingURI = ref<string>(`${ws_protocol}://${globalAddress.value}:6021/`)
Expand Down
6 changes: 3 additions & 3 deletions src/stores/widgetManager.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import '@/libs/cosmos'

import { useDebounceFn, useWindowSize } from '@vueuse/core'
import { useDebounceFn, useStorage, useWindowSize } from '@vueuse/core'
import { saveAs } from 'file-saver'
import { defineStore } from 'pinia'
import Swal from 'sweetalert2'
Expand Down Expand Up @@ -50,8 +50,8 @@ export const useWidgetManagerStore = defineStore('widget-manager', () => {
const gridInterval = ref(0.01)
const currentMiniWidgetsProfile = useBlueOsStorage('cockpit-mini-widgets-profile-v4', miniWidgetsProfile)
const savedProfiles = useBlueOsStorage<Profile[]>(savedProfilesKey, [])
const currentViewIndex = useBlueOsStorage('cockpit-current-view-index', 0)
const currentProfileIndex = useBlueOsStorage('cockpit-current-profile-index', 0)
const currentViewIndex = useStorage('cockpit-current-view-index', 0)
const currentProfileIndex = useStorage('cockpit-current-profile-index', 0)
const desiredTopBarHeightPixels = ref(48)
const desiredBottomBarHeightPixels = ref(48)
const visibleAreaMinClearancePixels = ref(20)
Expand Down

0 comments on commit 8305394

Please sign in to comment.