Skip to content

Commit

Permalink
refactor: simplify camera getter in SettingsTimelapseTab.vue
Browse files Browse the repository at this point in the history
Signed-off-by: Stefan Dej <[email protected]>
  • Loading branch information
meteyou committed Jun 28, 2024
1 parent 42fbcef commit be8175d
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/components/settings/SettingsTimelapseTab.vue
Original file line number Diff line number Diff line change
Expand Up @@ -871,17 +871,14 @@ export default class SettingsTimelapseTab extends Mixins(BaseMixin) {
this.$store.dispatch('server/timelapse/saveSetting', { duplicatelastframe: newVal })
}
get rawCamera() {
return this.$store.state.server.timelapse.settings.camera ?? null
}
get camera() {
if (this.rawCamera === null) return null
const value = this.$store.state.server.timelapse.settings.camera ?? null
if (
value === null ||
this.blockedsettings.includes('snapshoturl') ||
this.availableSnapshotWebcams.length === 0 ||
this.availableSnapshotWebcams.find((webcam) => webcam.name === this.rawCamera) === undefined
this.availableSnapshotWebcams.find((webcam) => webcam.name === value) === undefined
) {
return null
}
Expand Down

0 comments on commit be8175d

Please sign in to comment.