Compare commits

...

2 Commits

2 changed files with 9 additions and 3 deletions

View File

@ -52,7 +52,7 @@ const DashboardNavigation = () => {
const { userProfile } = useContext(AuthContext)
const { showSpotlight } = useContext(SpotlightContext)
const { connecting, connected } = useContext(ApiServerContext)
const { toggleNotificationCenter, unreadCount } =
const { toggleNotificationCenter, unreadCount, notificationCenterVisible } =
useContext(NotificationContext)
const [apiServerState, setApiServerState] = useState('disconnected')
const navigate = useNavigate()
@ -335,7 +335,7 @@ const DashboardNavigation = () => {
<>
{isElectron ? (
<Flex
className='ant-menu-horizontal ant-menu-light electron-navigation-wrapper'
className={`ant-menu-horizontal ant-menu-light${!notificationCenterVisible ? ' electron-navigation-wrapper' : ''}`}
style={{ lineHeight: '40px', padding: '0 2px 0 2px' }}
>
{navigationContents}

View File

@ -19,7 +19,7 @@ const NotificationContext = createContext()
const NotificationProvider = ({ children }) => {
const [api, contextHolder] = notification.useNotification()
const location = useLocation()
const { authenticated } = useContext(AuthContext)
const { authenticated, token } = useContext(AuthContext)
const {
showError,
fetchNotificationsApi,
@ -118,6 +118,12 @@ const NotificationProvider = ({ children }) => {
}
}, [authenticated, notificationCenterVisible, fetchNotifications])
useEffect(() => {
if (authenticated && token) {
fetchNotifications()
}
}, [authenticated, token, fetchNotifications])
useEffect(() => {
setNotificationCenterVisible(false)
}, [location.pathname])