update notification handling and improve sorting logic in NotificationTemplate component

This commit is contained in:
Mo Tarbin
2025-06-22 17:21:22 -04:00
parent 97fb8d8561
commit 5b83bf35d0
8 changed files with 316 additions and 263 deletions

View File

@@ -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