Fix default address switch state

This commit is contained in:
marzban-dev
2026-04-23 20:35:27 +03:30
parent 373b7308d4
commit fb3425fd0b
2 changed files with 8 additions and 5 deletions
@@ -40,7 +40,7 @@ const addressData = ref({
address: address.value?.address ?? "",
name: address.value?.name ?? "",
phone: address.value?.phone ?? "",
for_me: !isEditing.value ? address.value?.for_me ?? "بله" : address.value?.for_me == true ? "بله" : "خیر",
for_me: !isEditing.value ? (address.value?.for_me ?? "بله") : address.value?.for_me == true ? "بله" : "خیر",
is_main: address.value?.is_main ?? false,
});
@@ -128,7 +128,7 @@ const handleSubmit = async () => {
},
});
},
}
},
);
}
};
@@ -137,12 +137,12 @@ watch(
() => [addressData.value.for_me, isShow.value],
([newValue, newValue2]) => {
if (!isEditing.value) {
addressData.value.phone = newValue == "بله" && newValue2 ? account.value?.phone ?? "" : "";
addressData.value.phone = newValue == "بله" && newValue2 ? (account.value?.phone ?? "") : "";
}
},
{
immediate: true,
}
},
);
</script>
@@ -283,6 +283,9 @@ watch(
>
به عنوان آدرس پیش فرض ثبت شود؟
</label>
<!-- {{ address?.is_main }} -->
<Switch
id="is_main"
v-model="addressData.is_main"