fix useCurrentServerId hook to always return a string

This commit is contained in:
jeffvli
2025-11-25 16:22:43 -08:00
parent 2264fa0d29
commit 6f132f745b
+4 -3
View File
@@ -112,14 +112,15 @@ export const useAuthStore = createWithEqualityFn<AuthSlice>()(
), ),
); );
export const useCurrentServerId = () => export const useCurrentServerId = (): string =>
useAuthStore((state) => { useAuthStore((state) => {
const currentServer = state.currentServer; const currentServer = state.currentServer;
if (!currentServer) { if (!currentServer) {
return null; return '';
} }
return currentServer.id || ''; return currentServer.id;
}, shallow); }, shallow);
export const useCurrentServer = () => export const useCurrentServer = () =>