From fb3425fd0b8a9da2905b6bf5b0bcb4443cd8f574 Mon Sep 17 00:00:00 2001 From: marzban-dev Date: Thu, 23 Apr 2026 20:35:27 +0330 Subject: [PATCH] Fix default address switch state --- frontend/components/cart/delivery/AddressModal.vue | 11 +++++++---- frontend/components/global/Switch.vue | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/frontend/components/cart/delivery/AddressModal.vue b/frontend/components/cart/delivery/AddressModal.vue index 3e086da..d82b942 100644 --- a/frontend/components/cart/delivery/AddressModal.vue +++ b/frontend/components/cart/delivery/AddressModal.vue @@ -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, - } + }, ); @@ -283,6 +283,9 @@ watch( > به عنوان آدرس پیش فرض ثبت شود؟ + + + (); // computed const value = computed({ - get: () => (modelValue.value == "true" ? true : false), + get: () => modelValue.value, set: (value) => { emit("update:modelValue", value); },