Skip to content
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

Merged
merged 3 commits into from
Oct 26, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/components/FeaturePanel/EditDialog/useGetOnClose.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Copy link
Owner

@zbycz zbycz Oct 17, 2024

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

Copy link
Contributor Author

@kudlav kudlav Oct 19, 2024

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.

Copy link
Owner

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. 👌

}
};
};
Loading