diff --git a/web/containers/WaitingCortexModal/index.tsx b/web/containers/WaitingCortexModal/index.tsx index 19739d90e..f186ac9d1 100644 --- a/web/containers/WaitingCortexModal/index.tsx +++ b/web/containers/WaitingCortexModal/index.tsx @@ -1,4 +1,4 @@ -import { useCallback, useEffect } from 'react' +import { useCallback, useEffect, useState } from 'react' import { Modal } from '@janhq/joi' import { useAtom, useAtomValue } from 'jotai' @@ -13,6 +13,7 @@ import { hostAtom } from '@/helpers/atoms/AppConfig.atom' const WaitingForCortexModal: React.FC = () => { const host = useAtomValue(hostAtom) const [waitingForCortex, setWaitingForCortex] = useAtom(waitingForCortexAtom) + const [timedOut, setTimedOut] = useState(false) const { isSystemAlive } = useCortex() const checkSystemAlive = useCallback(async () => { @@ -24,17 +25,38 @@ const WaitingForCortexModal: React.FC = () => { checkSystemAlive() }, [checkSystemAlive]) + useEffect(() => { + setTimeout(() => { + if (waitingForCortex) setTimedOut(true) + }, 5000) + }, [waitingForCortex]) + return (

- Please ensure that cortex is up and running at {host} + Running API Server at{' '} + + {host}/api + + , please wait for a moment... +

+ {timedOut && ( + + The API server is taking longer than usual to start. If this + process continues to run for a minute, please check the log file + under the Jan Data Folder path or restart the application. + + )}

- }