update notification handling and improve sorting logic in NotificationTemplate component
This commit is contained in:
@@ -34,11 +34,12 @@ export const useUserProfile = () => {
|
||||
const { data, error, isLoading } = useQuery({
|
||||
queryKey: ['userProfile'],
|
||||
queryFn: async () => {
|
||||
const resp = await GetUserProfile()
|
||||
const result = await resp.json()
|
||||
if (!isTokenValid()) {
|
||||
return null // Token is invalid, return null to indicate no profile
|
||||
}
|
||||
const resp = await GetUserProfile()
|
||||
const result = await resp.json()
|
||||
|
||||
return result.res // Return the actual user profile data
|
||||
},
|
||||
staleTime: 30 * 60 * 1000, // 30 minutes in milliseconds
|
||||
|
||||
Reference in New Issue
Block a user