I want a nanoflow to wait until Reload is finished

0
In my app, the user can change the language he is using in his user profile. However, for the language change to have any effect, a reload of the page is needed. I created a nanoflow with the reload function in order to make that happen. Of course, reload makes the user go back to the home page, while I want him to go back to his profile page. So I added a 'Show page' after 'Reload'. However, the reload takes more time to finish than the nanoflow itself, so it hits the 'Show page' function while the page is still reloading, which means the whole thing still ends up on the home page.    So I want to pause the nanoflow until the reload is finished, but how? Can I add something to the javascript of Reload? It is already an async funtion with a promise if I see correctly.     My Mendix version is 10.12.6. by the way, but that wasn´t listed in the dropdowmenu. 
asked
4 answers
2

Hi Birgit,

you can reload with same state , it won't redirect to other page and language will also reflect

follow 4th pont in below doc

https://docs.mendix.com/refguide/translatable-texts/

answered
1

Hi Birgit,

 

If you just want to change the language of the user, just do the retrieve of the language and the change of both currentuser and account entity and commit and refresh and then show the page you want the user to go to (so no need to reload page). 

 

Hope it helps!

Thanks & Regards,

Manikandan K

answered
1

Maybe use a custom javascript action? Set an url on the profile page like /profile. Then reload and redirect like this:

await location.reload();
location.href = document.location.origin + "/p/profile";

 

answered
0

Hi,

In the nanoflow commons module  , there is js action called Delay or Wait that you can use that

answered