You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The "logout" is another page (component) we can navigate to, that essentially does this
deflogout(router):
# do some logic# logic gives some URL that we need to redirect to (external possibly)router.push(logout_url)
@solara.componentdefLogout():
router=solara.use_router()
# Some other solara visual components to be loaded.. like a progress bar or sosolara.use_effect(lambda: logout(router), [])
In the above example, some kind of race condition happens, or whatever is called when the order of the routes/redirects/pushes is mixed up, and the process does not complete as it should. Which is strange to me as the use_effect should wait before everything is done/rendered before it executes the function right?
However, If I do something like this, everything works fine!
The example that works as expected:
deflogout():
# some logic that does stuff and generates an logout urlreturnlogout_url@solara.componentdefLogout():
router=solara.use_router()
# Some other solara visual components to be loaded.. like a progress bar or sodefperform_logout():
logout_url=logout()
router.push(logout_url)
solara.use_effect(perform_logout, [])
There is something fundamental I do not understand here.. may someone shed a bit of light here.. i hope the example is clear enough.. would be very challening to make a working example of this.
Many thanks!
The text was updated successfully, but these errors were encountered:
Yes! :)
I thought so too.. but option one..i think essentially gets to some race conditions and one rerouting is interrupted by another.
In option 2 it does not happen somehow.. i wanted to understand it.. and know if I am doing anything wrong..
Perhaps something with the rendering etc.. but i thought use_effect takes care of that (waits until the render is complete). But maybe with routing is different?
Hello again,
Another.. tricky to explain question but I hope I will get the message across..
Say there is a button that does something like this
The "logout" is another page (component) we can navigate to, that essentially does this
In the above example, some kind of race condition happens, or whatever is called when the order of the routes/redirects/pushes is mixed up, and the process does not complete as it should. Which is strange to me as the
use_effect
should wait before everything is done/rendered before it executes the function right?However, If I do something like this, everything works fine!
The example that works as expected:
There is something fundamental I do not understand here.. may someone shed a bit of light here.. i hope the example is clear enough.. would be very challening to make a working example of this.
Many thanks!
The text was updated successfully, but these errors were encountered: