mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-07 20:40:15 +02:00
fix useCurrentServerId hook to always return a string
This commit is contained in:
@@ -112,14 +112,15 @@ export const useAuthStore = createWithEqualityFn<AuthSlice>()(
|
||||
),
|
||||
);
|
||||
|
||||
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 = () =>
|
||||
|
||||
Reference in New Issue
Block a user