Compare commits
2 Commits
128cf603e7
...
1b8f0b1445
| Author | SHA1 | Date | |
|---|---|---|---|
| 1b8f0b1445 | |||
| 6d839ebe9c |
@ -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}
|
||||
|
||||
@ -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])
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user