Next.js Discord

Discord Forum

How to wait until `router.refresh` ends?

Unanswered
Transvaal lion posted this in #help-forum
Open in Discord
Transvaal lionOP
Hey, i can't really rely on revalidatePath in server actions, because my wallet wont handle so much data mutations + revalidations at once. How can I await when router.refresh ends and then for example close modal?

3 Replies

European sprat
Try / catch / finally and out the modal close in finally
Transvaal lionOP
can route.refresh() throw?
Transvaal lionOP
actually, not sure this should work.