File size: 422 Bytes
3206347 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
import { useNavigate } from 'react-router-dom';
import useAutomatischInfo from './useAutomatischInfo';
export default function useCloud(options) {
const redirect = options?.redirect || false;
const navigate = useNavigate();
const { data: automatischInfo } = useAutomatischInfo();
const isCloud = automatischInfo?.data.isCloud;
if (isCloud === false && redirect) {
navigate('/');
}
return isCloud;
}
|