refactor: rewrite useAutomatischInfo with RQ and REST API
This commit is contained in:
@@ -1,11 +1,17 @@
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
|
||||
import useAutomatischInfo from './useAutomatischInfo';
|
||||
|
||||
export default function useCloud(options) {
|
||||
const redirect = options?.redirect || false;
|
||||
const { isCloud } = useAutomatischInfo();
|
||||
const navigate = useNavigate();
|
||||
const { data: automatischInfo } = useAutomatischInfo();
|
||||
|
||||
const isCloud = automatischInfo?.data.isCloud;
|
||||
|
||||
if (isCloud === false && redirect) {
|
||||
navigate('/');
|
||||
}
|
||||
|
||||
return isCloud;
|
||||
}
|
||||
|
Reference in New Issue
Block a user