-
-
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
Conversation
✅ Deploy Preview for pocre ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
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 tested switching between 2 wallets and It doesn't work for me. I see creations associated to other users, I have to refresh the page to remove the "cache".
Yes i also noticed that , the non draft creations of previous login continue to display , i am looking into it |
I would suggest we add a cache helper to handle all cache related problems. But for now let's get it working |
The approach of resetting/invalidating query client looks correct. Maybe also try queryClient.resetQueries() |
Creations.loading.without.refresh.webm@AltiMario correct creation are now being loaded without refresh |
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.
There is a problem when you switch user, trying to see the other user creations.
I want to see rhuzaifa creations but the link points to Bruno's creations
https://deploy-preview-341--pocre.netlify.app/creations/user/b13796a4-bc33-4db8-823e-bd25d3251da3
Creations of separate route for public creations leads to these desirable results |
Multiple.Wallet.and.Multiple.user.Creations.webm |
Results.from.Deploy.Preview.webmDeploy Preview |
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.
looks good to me :-)
|
||
const useCreations = (userId) => { | ||
const cookieUser = Cookies.get('authUser'); |
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
import authUser from 'utils/helpers/authUser';
// get auth user
const user = authUser.getUser();
const useCreations = (userId) => {
// ... other code
we can do this
import authUser from 'utils/helpers/authUser';
const useCreations = (userId) => {
// get auth user
const user = authUser.getUser();
// ...other code
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
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 comment
The 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 comment
The 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 comment
The 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 comment
The reason will be displayed to describe this comment to others. Learn more.
done
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.
.
avoid.refresh.1.webm