-
-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
avoid refresh due to cash issue fixed #341
Changes from 3 commits
eade541
6e74f30
60b3e59
cff268d
82096c0
a0fdfb0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,7 @@ import Loader from 'components/uicore/Loader'; | |
import useAppKeys from 'hooks/useAppKeys'; | ||
import { useEffect, useState } from 'react'; | ||
import { useNavigate } from 'react-router-dom'; | ||
import { useQueryClient } from '@tanstack/react-query'; | ||
import useProfile from './useProfile'; | ||
import UserAvatar from './userAvatar'; | ||
import { updateProfileValidation } from './validation'; | ||
|
@@ -31,11 +32,16 @@ function WalletProfile({ | |
emailVerified = false, | ||
}) { | ||
const { updateAppKey } = useAppKeys(); | ||
const queryClient = useQueryClient(); | ||
const navigate = useNavigate(); | ||
const [isEditMode, setEditMode] = useState(false); | ||
const [avatarImageFile, setAvatarImageFile] = useState(); | ||
const handleViewCreation = () => { | ||
if (id) { | ||
setTimeout(() => { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are we adding this to refresh cache? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes , because the new queries are called instantly so i added delay in the refresh cache There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nice thinking here, but maybe the delay is fine and expected since the user is visiting a creation page of another user (a different route) and we most probably wont have these types of data in cache. I think lets not use it here There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done |
||
queryClient.cancelQueries(); | ||
queryClient.invalidateQueries(); | ||
}, 800); | ||
navigate(`/creations/user/${id}`); | ||
} else { | ||
navigate('/creations'); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use the 'authUser' helper here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
authHelper was not working
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think its probably because its called outside the component body. So instead of
we can do this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done thanks