This commit is contained in:
@@ -146,9 +146,7 @@
|
||||
set: (value) => emit('update:modelValue', value)
|
||||
})
|
||||
|
||||
const currentModeValue = computed<0 | 1>(() =>
|
||||
Number(props.currentMode) === 1 ? 1 : 0
|
||||
)
|
||||
const currentModeValue = computed<0 | 1>(() => (Number(props.currentMode) === 1 ? 1 : 0))
|
||||
|
||||
const availableCards = computed(() => props.cards || [])
|
||||
|
||||
@@ -157,7 +155,9 @@
|
||||
const syncFormState = () => {
|
||||
form.switch_mode = currentModeValue.value
|
||||
|
||||
const selectedStillExists = availableCards.value.some((card) => card.iot_card_id === form.iot_card_id)
|
||||
const selectedStillExists = availableCards.value.some(
|
||||
(card) => card.iot_card_id === form.iot_card_id
|
||||
)
|
||||
if (!selectedStillExists) {
|
||||
form.iot_card_id = availableCards.value[0]?.iot_card_id
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user