Skip to content

Commit

Permalink
dont load notification center when closed
Browse files Browse the repository at this point in the history
Signed-off-by: codeSafari10 <[email protected]>
  • Loading branch information
codeSafari10 committed Aug 21, 2024
1 parent e51c8ff commit e6112ce
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions ui/components/NotificationCenter/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ import DeleteIcon from '../../assets/icons/DeleteIcon';
import { useNotification } from '../../utils/hooks/useNotification';
import { useActorRef } from '@xstate/react';
import { operationsCenterActor } from 'machines/operationsCenter';
import { useSelectorRtk } from '@/store/hooks';

export const NotificationCenterContext = React.createContext({
drawerAnchorEl: null,
Expand Down Expand Up @@ -579,6 +580,12 @@ export const NotificationDrawerButton = () => {
};

const NotificationCenter = (props) => {
const isOpen = useSelectorRtk((state) => state.events.isNotificationCenterOpen);

if (!isOpen) {
return null;
}

return (
<NoSsr>
<ErrorBoundary
Expand Down

0 comments on commit e6112ce

Please sign in to comment.