CognxSafeTrack Claude Sonnet 4.6 commited on
Commit ·
4f87bfb
1
Parent(s): 91bb670
fix(admin): show Reconfigurer WhatsApp when phone exists but token/wabaId missing
Browse filesOrgs migrated from single-tenant setup have a WhatsAppPhoneNumber record but no
wabaId/systemUserToken in Organization table. Without the token the Meta status
endpoint returns configured:false and WABA shows "Non connecté".
When fetchMetaStatus returns configured:false on an org that already has a phone
number, replace the "En ligne" indicator with an amber "Reconfigurer WhatsApp"
button that re-triggers the Embedded Signup flow to store the correct wabaId and
long-lived token.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
apps/admin/src/pages/ClientsManagementView.tsx
CHANGED
|
@@ -178,13 +178,22 @@ export default function ClientsManagementView() {
|
|
| 178 |
<p className="text-xs text-slate-400">ID: {client.phoneNumbers[0].id}</p>
|
| 179 |
</div>
|
| 180 |
<div className="h-10 w-px bg-slate-100"></div>
|
| 181 |
-
|
| 182 |
-
<
|
| 183 |
-
|
| 184 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 185 |
</div>
|
| 186 |
) : (
|
| 187 |
-
<button
|
| 188 |
onClick={() => handleEmbeddedSignup(client.id)}
|
| 189 |
className="flex items-center gap-2 bg-indigo-600 text-white px-5 py-2.5 rounded-xl font-semibold hover:bg-indigo-700 transition shadow-lg shadow-indigo-100"
|
| 190 |
>
|
|
|
|
| 178 |
<p className="text-xs text-slate-400">ID: {client.phoneNumbers[0].id}</p>
|
| 179 |
</div>
|
| 180 |
<div className="h-10 w-px bg-slate-100"></div>
|
| 181 |
+
{metaStatuses[client.id] && !metaStatuses[client.id].loading && !metaStatuses[client.id].configured ? (
|
| 182 |
+
<button
|
| 183 |
+
onClick={() => handleEmbeddedSignup(client.id)}
|
| 184 |
+
className="flex items-center gap-2 bg-amber-500 text-white px-4 py-2 rounded-xl font-semibold hover:bg-amber-600 transition text-xs"
|
| 185 |
+
>
|
| 186 |
+
<AlertTriangle className="w-3.5 h-3.5" /> Reconfigurer WhatsApp
|
| 187 |
+
</button>
|
| 188 |
+
) : (
|
| 189 |
+
<div className="flex items-center gap-2 text-emerald-600">
|
| 190 |
+
<Activity className="w-4 h-4" />
|
| 191 |
+
<span className="font-medium text-xs">En ligne</span>
|
| 192 |
+
</div>
|
| 193 |
+
)}
|
| 194 |
</div>
|
| 195 |
) : (
|
| 196 |
+
<button
|
| 197 |
onClick={() => handleEmbeddedSignup(client.id)}
|
| 198 |
className="flex items-center gap-2 bg-indigo-600 text-white px-5 py-2.5 rounded-xl font-semibold hover:bg-indigo-700 transition shadow-lg shadow-indigo-100"
|
| 199 |
>
|