CFE-21 sidebar test
This commit is contained in:
@@ -1,8 +1,10 @@
|
||||
import useSWR from 'swr'
|
||||
import {GET_SIDEBAR_NOTIFICATION} from "@/core/data/apiRoutes";
|
||||
import useRequest from "@/lib/app/hooks/useRequest";
|
||||
const isNotificationEnabled = process.env.NEXT_HAS_NOTIFICATION === "true";
|
||||
|
||||
const useNotification = () => {
|
||||
|
||||
const requestServer = useRequest({auth: true, notification: false})
|
||||
|
||||
//swr config
|
||||
@@ -13,7 +15,7 @@ const useNotification = () => {
|
||||
})
|
||||
};
|
||||
|
||||
const {data, mutate} = useSWR(GET_SIDEBAR_NOTIFICATION, fetcher)
|
||||
const {data, mutate} = useSWR( isNotificationEnabled ? GET_SIDEBAR_NOTIFICATION : '', fetcher , {keepPreviousData:true})
|
||||
const notification_count = data
|
||||
//swr config
|
||||
|
||||
|
||||
Reference in New Issue
Block a user