From 6f132f745b748b233e2a1e2355067b22fccb20c8 Mon Sep 17 00:00:00 2001 From: jeffvli Date: Tue, 25 Nov 2025 16:22:43 -0800 Subject: [PATCH] fix useCurrentServerId hook to always return a string --- src/renderer/store/auth.store.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/renderer/store/auth.store.ts b/src/renderer/store/auth.store.ts index c08839db9..cd3b3f815 100644 --- a/src/renderer/store/auth.store.ts +++ b/src/renderer/store/auth.store.ts @@ -112,14 +112,15 @@ export const useAuthStore = createWithEqualityFn()( ), ); -export const useCurrentServerId = () => +export const useCurrentServerId = (): string => useAuthStore((state) => { const currentServer = state.currentServer; + if (!currentServer) { - return null; + return ''; } - return currentServer.id || ''; + return currentServer.id; }, shallow); export const useCurrentServer = () =>