diff --git a/src/components/Dashboard/common/DashboardNavigation.jsx b/src/components/Dashboard/common/DashboardNavigation.jsx index fa01e3c..e9739f2 100644 --- a/src/components/Dashboard/common/DashboardNavigation.jsx +++ b/src/components/Dashboard/common/DashboardNavigation.jsx @@ -18,7 +18,6 @@ import { LoadingOutlined } from '@ant-design/icons' import { AuthContext } from '../context/AuthContext' -import { PrintServerContext } from '../context/PrintServerContext' import { SpotlightContext } from '../context/SpotlightContext' import { ApiServerContext } from '../context/ApiServerContext' import { useNavigate, useLocation } from 'react-router-dom' @@ -36,7 +35,6 @@ import BellIcon from '../../Icons/BellIcon' import SearchIcon from '../../Icons/SearchIcon' import SettingsIcon from '../../Icons/SettingsIcon' import DeveloperIcon from '../../Icons/DeveloperIcon' -import PrinterIcon from '../../Icons/PrinterIcon' import { ElectronContext } from '../context/ElectronContext' import DashboardWindowButtons from './DashboardWindowButtons' @@ -44,9 +42,7 @@ const DashboardNavigation = () => { const { logout, userProfile } = useContext(AuthContext) const { showSpotlight } = useContext(SpotlightContext) const { toggleNotificationCenter, unreadCount } = useContext(ApiServerContext) - const { printServer } = useContext(PrintServerContext) - const { apiServer } = useContext(ApiServerContext) - const [printServerState, setPrintServerState] = useState('disconnected') + const { connecting, connected } = useContext(ApiServerContext) const [apiServerState, setApiServerState] = useState('disconnected') const navigate = useNavigate() const location = useLocation() @@ -62,24 +58,15 @@ const DashboardNavigation = () => { }, [location.pathname]) useEffect(() => { - if (printServer?.connecting) { - setPrintServerState('connecting') - } else if (printServer?.connected) { - setPrintServerState('connected') - } else { - setPrintServerState('disconnected') - } - }, [printServer?.connecting, printServer?.connected]) - - useEffect(() => { - if (apiServer?.connecting) { + if (connecting == true) { setApiServerState('connecting') - } else if (apiServer?.connected) { + } else if (connected == true) { setApiServerState('connected') } else { setApiServerState('disconnected') } - }, [apiServer?.connecting, apiServer?.connected]) + console.log('Connecting/connected', connecting, connected) + }, [connecting, connected]) const mainMenuItems = [ { @@ -191,33 +178,6 @@ const DashboardNavigation = () => { {process.env.NODE_ENV === 'development' && ( - {printServerState === 'connected' ? ( - - } - /> - - ) : null} - {printServerState === 'connecting' ? ( - - } - /> - - ) : null} - {printServerState === 'disconnected' ? ( - - } - /> - - ) : null} {apiServerState === 'connected' ? ( { {apiServerState === 'connecting' ? ( } />