From 5d9c979ace131effa9ef071c6c815e9b30bf04c5 Mon Sep 17 00:00:00 2001 From: Tanmay Deep Sharma Date: Wed, 13 May 2026 15:02:36 +0530 Subject: [PATCH] feat(voice): resolve country name from country_code in call widget When a contact has only country_code (e.g. "US") stored in additional_attributes and not the full country name, the floating call widget now falls back to the shared countries list to render "City, Country" in the location line. --- .../dashboard/components/widgets/FloatingCallWidget.vue | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/javascript/dashboard/components/widgets/FloatingCallWidget.vue b/app/javascript/dashboard/components/widgets/FloatingCallWidget.vue index 087307ff6..f2fac68c9 100644 --- a/app/javascript/dashboard/components/widgets/FloatingCallWidget.vue +++ b/app/javascript/dashboard/components/widgets/FloatingCallWidget.vue @@ -7,6 +7,7 @@ import { setWhatsappCallMuted } from 'dashboard/composables/useWhatsappCallSessi import { frontendURL, conversationUrl } from 'dashboard/helper/URLHelper'; import WindowVisibilityHelper from 'dashboard/helper/AudioAlerts/WindowVisibilityHelper'; import CallCard from 'dashboard/components/widgets/call/CallCard.vue'; +import countriesList from 'shared/constants/countries.js'; const RINGTONE_URL = '/audio/dashboard/bell.mp3'; @@ -71,8 +72,11 @@ const getCallInfo = call => { const caller = call?.caller; const additional = sender?.additional_attributes || {}; const city = additional.city || ''; - const country = additional.country || ''; const countryCode = additional.country_code || ''; + const country = + additional.country || + countriesList.find(c => c.id === countryCode.toUpperCase())?.name || + ''; // Prefer the richest available location string ("City, Country"); fall back to // whichever single field is present; finally fall back to the inbox name so // there's always something to show.