From 5eda23b7aab636eb6ecd32804f10d96ac093dc7b Mon Sep 17 00:00:00 2001
From: Simula_r <18093452+simula-r@users.noreply.github.com>
Date: Mon, 26 Jan 2026 16:33:00 -0800
Subject: [PATCH] =?UTF-8?q?fix:=20workspace=20icon=20flash=20and=20credits?=
=?UTF-8?q?=20showing=200=20while=20workspace=20is=20in=E2=80=A6=20(#8323)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
## Summary
- Fix: flash of wrong workspace icon (replaced with loader)
- Fix: personal workspace showing 0 credits
┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-8323-fix-workspace-icon-flash-and-credits-showing-0-while-workspace-is-in-2f46d73d36508159b52fec3fa0c17e35)
by [Unito](https://www.unito.io)
---
.../topbar/CurrentUserButton.test.ts | 19 ++++++++++-
src/components/topbar/CurrentUserButton.vue | 34 ++++++++++++++-----
.../topbar/CurrentUserPopoverWorkspace.vue | 16 ++++++---
3 files changed, 55 insertions(+), 14 deletions(-)
diff --git a/src/components/topbar/CurrentUserButton.test.ts b/src/components/topbar/CurrentUserButton.test.ts
index db5349b49..c8e568291 100644
--- a/src/components/topbar/CurrentUserButton.test.ts
+++ b/src/components/topbar/CurrentUserButton.test.ts
@@ -25,7 +25,24 @@ vi.mock('firebase/auth', () => ({
}))
// Mock pinia
-vi.mock('pinia')
+vi.mock('pinia', () => ({
+ storeToRefs: vi.fn((store) => store)
+}))
+
+// Mock the useFeatureFlags composable
+vi.mock('@/composables/useFeatureFlags', () => ({
+ useFeatureFlags: vi.fn(() => ({
+ flags: { teamWorkspacesEnabled: false }
+ }))
+}))
+
+// Mock the useTeamWorkspaceStore
+vi.mock('@/platform/workspace/stores/teamWorkspaceStore', () => ({
+ useTeamWorkspaceStore: vi.fn(() => ({
+ workspaceName: { value: '' },
+ initState: { value: 'idle' }
+ }))
+}))
// Mock the useCurrentUser composable
vi.mock('@/composables/auth/useCurrentUser', () => ({
diff --git a/src/components/topbar/CurrentUserButton.vue b/src/components/topbar/CurrentUserButton.vue
index fde213498..85d587e91 100644
--- a/src/components/topbar/CurrentUserButton.vue
+++ b/src/components/topbar/CurrentUserButton.vue
@@ -12,12 +12,18 @@
:class="
cn(
'flex items-center gap-1 rounded-full hover:bg-interface-button-hover-surface justify-center',
- compact && 'size-full aspect-square'
+ compact && 'size-full '
)
"
>
+
@@ -40,13 +46,16 @@
}
}"
>
-
+
-
+
@@ -54,6 +63,7 @@