fix(contacts): expose root country code
This commit is contained in:
@@ -37,6 +37,10 @@ const props = defineProps({
|
||||
type: Object,
|
||||
default: () => ({}),
|
||||
},
|
||||
countryCode: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
updatedAt: {
|
||||
type: Number,
|
||||
default: 0,
|
||||
@@ -60,12 +64,17 @@ const updatedAtTime = computed(() => {
|
||||
});
|
||||
|
||||
const countryDetails = computed(() => {
|
||||
const { country, countryCode, city } = props.additionalAttributes;
|
||||
const {
|
||||
country,
|
||||
countryCode: additionalCountryCode,
|
||||
city,
|
||||
} = props.additionalAttributes;
|
||||
const countryCode = props.countryCode || additionalCountryCode;
|
||||
|
||||
if (!country && !countryCode) return null;
|
||||
|
||||
const activeCountry =
|
||||
countriesMap.value[country] || countriesMap.value[countryCode];
|
||||
countriesMap.value[countryCode] || countriesMap.value[country];
|
||||
|
||||
if (!activeCountry) return null;
|
||||
|
||||
|
||||
@@ -41,6 +41,7 @@ const accountId = useMapGetter('getCurrentAccountId');
|
||||
:name="contact.name"
|
||||
:email="contact.email"
|
||||
:phone="contact.phoneNumber"
|
||||
:country-code="contact.countryCode"
|
||||
:additional-attributes="contact.additionalAttributes"
|
||||
:account-id="accountId"
|
||||
:thumbnail="contact.thumbnail"
|
||||
|
||||
Reference in New Issue
Block a user