From 2aa8391e001f7e852ec001532ac66962dfcf497f Mon Sep 17 00:00:00 2001 From: Mohamad Choupan Date: Mon, 13 Jan 2025 23:33:29 +0330 Subject: [PATCH] add migrator to first login --- services/web-ui/src/pages/Overview/index.tsx | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/services/web-ui/src/pages/Overview/index.tsx b/services/web-ui/src/pages/Overview/index.tsx index 4b4335dbb..e93908b39 100644 --- a/services/web-ui/src/pages/Overview/index.tsx +++ b/services/web-ui/src/pages/Overview/index.tsx @@ -20,6 +20,7 @@ import { ForbiddenAtom, meAtom, notificationAtom } from '../../store' import { useAuth } from '../../utilities/auth' import { useAuthApiV1UserInviteCreate } from '../../api/auth.gen' import Integrations from './Integrations' +import { useComplianceApiV1QueriesSyncList } from '../../api/compliance.gen' export default function Overview() { @@ -91,6 +92,9 @@ export default function Overview() { // const temp = [] if (res.data == 'CHANGE_REQUIRED') { setChange(true) + if (me?.email == 'admin@opencomply.io') { + runSync() + } } }) .catch((err) => { @@ -170,11 +174,19 @@ export default function Overview() { setLoadingChange(false) }) } +const { + isLoading: syncLoading, + isExecuted: syncExecuted, + error: syncError, + sendNow: runSync, +} = useComplianceApiV1QueriesSyncList({}, {}, false) + useEffect(() => { if (me?.connector_id === 'local') { PassCheck() } + }, [me]) const CheckEmail = () => { if (!userData?.email || userData?.email == '') {