Skip to content

Commit

Permalink
Allow availableIceIps variable to be undefined when it was not yet …
Browse files Browse the repository at this point in the history
…explicitly set

This allows one to track when it is was already populated, and react to that.
  • Loading branch information
rafaellehmkuhl committed Nov 27, 2023
1 parent 54069f6 commit 5e538a5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/components/widgets/VideoPlayer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ watch(selectedICEIPsField, () => {
})
setInterval(() => {
const combinedIps = [...videoStore.availableIceIps, ...availableICEIPs.value]
const combinedIps = [...(videoStore.availableIceIps ?? []), ...availableICEIPs.value]
const uniqueIps = combinedIps.filter((value, index, array) => array.indexOf(value) === index)
videoStore.availableIceIps = uniqueIps
}, 1000)
Expand Down
4 changes: 2 additions & 2 deletions src/stores/video.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import { saveAs } from 'file-saver'
import localforage from 'localforage'
import { defineStore } from 'pinia'
import Swal from 'sweetalert2'
import { reactive } from 'vue'
import { ref } from 'vue'

export const useVideoStore = defineStore('video', () => {
const availableIceIps = reactive<string[]>([])
const availableIceIps = ref<string[] | undefined>(undefined)
const allowedIceIps = useStorage<string[]>('cockpit-allowed-stream-ips', [])

// Offer download of backuped videos
Expand Down

0 comments on commit 5e538a5

Please sign in to comment.