From 7fe246b784e1ee4100e833ae26f0ac47816e925b Mon Sep 17 00:00:00 2001 From: erio Date: Fri, 6 Mar 2026 17:00:46 +0800 Subject: [PATCH] fix: show affinity badge for enabled accounts even with 0 clients - Backend: remove count > 0 filter in GetAccountAffinityCountBatch so accounts with 0 bound clients are included in the response - Frontend: change badge condition from affinityClientCount > 0 to account.client_affinity_enabled so the badge always shows for accounts with affinity enabled Co-Authored-By: Claude Opus 4.6 --- backend/internal/repository/gateway_cache.go | 4 +--- frontend/src/components/account/AccountStatusIndicator.vue | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/backend/internal/repository/gateway_cache.go b/backend/internal/repository/gateway_cache.go index 6fed5b6874..6ca8319e44 100644 --- a/backend/internal/repository/gateway_cache.go +++ b/backend/internal/repository/gateway_cache.go @@ -188,9 +188,7 @@ func (c *gatewayCache) GetAccountAffinityCountBatch(ctx context.Context, account if err != nil && err != redis.Nil { continue } - if count > 0 { - result[id] = count - } + result[id] = count } return result, nil } diff --git a/frontend/src/components/account/AccountStatusIndicator.vue b/frontend/src/components/account/AccountStatusIndicator.vue index 3a8d632f42..4465cff482 100644 --- a/frontend/src/components/account/AccountStatusIndicator.vue +++ b/frontend/src/components/account/AccountStatusIndicator.vue @@ -2,7 +2,7 @@