mirror of
https://github.com/jeffvli/feishin.git
synced 2026-06-14 23:44:01 +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) => {
|
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 = () =>
|
||||||
|
|||||||
Reference in New Issue
Block a user