mirror of
https://github.com/Buriburizaem0n/admin-frontend-domain.git
synced 2026-11-04 16:50:20 +00:00
implement setting page (#12)
This commit is contained in:
1 parent
f17bdbf760
commit
3b5023061b
21 files changed
+941
-36
No files matched your search
@@ -3,6 +3,7 @@ import { useNotificationStore } from "./useNotificationStore"
|
||||
import { getNotificationGroups } from "@/api/notification-group"
|
||||
import { getNotification } from "@/api/notification"
|
||||
import { NotificationContextProps } from "@/types"
|
||||
import { useLocation } from "react-router-dom"
|
||||
|
||||
const NotificationContext = createContext<NotificationContextProps>({});
|
||||
|
||||
@@ -19,6 +20,8 @@ export const NotificationProvider: React.FC<NotificationProviderProps> = ({ chil
|
||||
const notifiers = useNotificationStore(store => store.notifiers);
|
||||
const setNotifier = useNotificationStore(store => store.setNotifier);
|
||||
|
||||
const location = useLocation();
|
||||
|
||||
useEffect(() => {
|
||||
if (withNotifierGroup)
|
||||
(async () => {
|
||||
@@ -39,7 +42,7 @@ export const NotificationProvider: React.FC<NotificationProviderProps> = ({ chil
|
||||
setNotifier(undefined);
|
||||
}
|
||||
})();
|
||||
}, [])
|
||||
}, [location.pathname])
|
||||
|
||||
const value: NotificationContextProps = useMemo(() => ({
|
||||
notifiers: notifiers,
|
||||
|
||||
Reference in new issue
Block a user