From 95f0eac0793dbcc1e718b14f99efa7370ef42f71 Mon Sep 17 00:00:00 2001 From: Samir Boulahtit Date: Sun, 29 Mar 2026 23:24:16 +0200 Subject: [PATCH] fix(tenancy): prioritize active over pending in member status display MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit getMemberStatus() showed "pending" if ANY store had a pending invitation, even if the member was already active in another store. Now checks for active stores first — a member who is active in at least one store shows as "active", not "pending". Co-Authored-By: Claude Opus 4.6 (1M context) --- app/modules/tenancy/static/merchant/js/merchant-team.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/modules/tenancy/static/merchant/js/merchant-team.js b/app/modules/tenancy/static/merchant/js/merchant-team.js index 929927f3..01773130 100644 --- a/app/modules/tenancy/static/merchant/js/merchant-team.js +++ b/app/modules/tenancy/static/merchant/js/merchant-team.js @@ -347,8 +347,8 @@ function merchantTeam() { */ getMemberStatus(member) { if (!member.stores || member.stores.length === 0) return 'inactive'; + if (member.stores.some(s => s.is_active && !s.is_pending)) return 'active'; if (member.stores.some(s => s.is_pending)) return 'pending'; - if (member.stores.some(s => s.is_active)) return 'active'; return 'inactive'; },