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 = () =>