diff --git a/public/najva-messaging-sw.js b/public/najva-messaging-sw.js new file mode 100644 index 0000000..67206c3 --- /dev/null +++ b/public/najva-messaging-sw.js @@ -0,0 +1 @@ +importScripts('https://van.najva.com/static/js/service-worker.js'); \ No newline at end of file diff --git a/src/shared/Header.tsx b/src/shared/Header.tsx index 14fd988..9a65804 100644 --- a/src/shared/Header.tsx +++ b/src/shared/Header.tsx @@ -5,7 +5,7 @@ import { useTranslation } from 'react-i18next' import Notifications from '../pages/notification/Notification' import { useSharedStore } from './store/sharedStore' import { Popover, PopoverButton, PopoverPanel } from '@headlessui/react' -import { Link } from 'react-router-dom' +import { Link, useLocation } from 'react-router-dom' import { Paths } from '@/utils/Paths' import SideBarItem from './SideBarItem' import AvatarImage from '@/assets/images/avatar_image.png' @@ -19,6 +19,7 @@ const Header: FC = () => { const [showSearchResults, setShowSearchResults] = useState(false) const [inputFocused, setInputFocused] = useState(false) const [showMobileSearch, setShowMobileSearch] = useState(false) + const { pathname } = useLocation() const { t } = useTranslation('global') const { setOpenSidebar, openSidebar } = useSharedStore() @@ -98,8 +99,12 @@ const Header: FC = () => { } }, []) + useEffect(() => { + setPopoverKey((prevKey) => prevKey + 1) + }, [pathname]) + return ( -