-
-
Notifications
You must be signed in to change notification settings - Fork 19
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
Reload FeaturePanel & EditDialog when done #685
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@@ -10,7 +10,8 @@ export const useGetOnClose = () => { | |||
return () => { | |||
close(); | |||
if (successInfo?.redirect) { | |||
router.replace(successInfo.redirect); // only useRouter reloads the panel client-side | |||
// Reloads the panel client-side | |||
router.replace('/').then(() => router.replace(successInfo?.redirect)); |
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.
Could you try redirecting user to url like /node/2432753840?version=7
?
I think we may be able to get the version from the osmApi. And it wouldn't run an unneccesary request to /
in between, thus making it quicker.
Do not implement any logic about the version
param, i think it would just tell browser to refresh it.
If this doesn't work somehow, I am ok with your solution as it is much better than current 😅
btw, i will be vacationing for next few weeks, mostly offline. 🏖️😃 @Dlurak can help you merge this if he has time
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.
Tried router.replace with:
- /node/597644745 to /node/597644745/4 ❌ no refresh
- /node/597644745 to /node/597644745?v=4 ❌ no refresh
So it seems that redirecting to / is necessary.
I tried router.replace even with unstable_skipClientCache: true
option.
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.
Thanks for the check. And thanks @Dlurak for merging. 👌
Description
Redraw FeaturePanel & EditDialog when changes are saved and the success info dialog is closed.
The previous code did nothing because the redirect URL was the same as the current URL:
Example links
Screenshots
Checklist