mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-08 04:50:12 +02:00
adjust network request waterfall to force authentication first, add fallback for no network (#1028)
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
import { Outlet } from 'react-router';
|
||||
|
||||
import { useServerAuthenticated } from '/@/renderer/hooks/use-server-authenticated';
|
||||
import { Center } from '/@/shared/components/center/center';
|
||||
import { Spinner } from '/@/shared/components/spinner/spinner';
|
||||
import { AuthState } from '/@/shared/types/types';
|
||||
|
||||
export const AuthenticationOutlet = () => {
|
||||
const authState = useServerAuthenticated();
|
||||
|
||||
if (authState === AuthState.LOADING) {
|
||||
return (
|
||||
<Center h="100vh" w="100%">
|
||||
<Spinner container />
|
||||
</Center>
|
||||
);
|
||||
}
|
||||
|
||||
return <Outlet />;
|
||||
};
|
||||
Reference in New Issue
Block a user