-
Notifications
You must be signed in to change notification settings - Fork 1
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
#95 + #96: To-do facturen + automatische deployment #20
#95 + #96: To-do facturen + automatische deployment #20
Conversation
…) is iets mee moet/kan. + Package updates (Expo patch van 49.0.13 naar 49.0.16 + bijbehorende updates) + Bugfix: app crasht soms na wisselen omgeving omdat de `url` in `data.nativeEvent` NULL kan zijn Extra loader toegevoegd aan SwitchEnvironmentScreen omdat soms het Dashboard al geladen werd terwijl de teller van het aantal openstaande to-do's nog niet was gereset na het wisselen van de omgeving. Nu wordt die navigatiestap pas gedaan nadat de query cache geleegd is.
setIsResetting(true); | ||
queryClient | ||
.resetQueries() | ||
.finally(() => { | ||
setIsResetting(false); | ||
navigation.navigate('Dashboard'); | ||
}); |
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.
Gewoon await hiervoor gebruiken lijkt mij. Je kan gewoon state setten na de await weer terugzetten.
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.
Behalve dat als er een error optreedt tijdens resetQueries
de gebruiker vast zit op een loading scherm en de app zelf moet force-killen. Dat is ook waarom ik dit in .finally()
doe en niet in .then()
.
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.
Je kan de await in try catch doen met een finall heb hetzelfde effect...
Je kan dan zelf de fetch weghalen.
Ik zie hier ook in de documentatie dat je errors kan negeren. door op options throwOnError op false te zetten
https://tanstack.com/query/v4/docs/react/reference/QueryClient#queryclientresetqueries
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.
Aangepast naar await
. Als er een error optreedt dan wordt die netjes doorgestuurd naar de parent promise nu.
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.
Kan je aanwijzen welke parent promise dit afhandeld? want ik kan het niet in de commit zien.
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.
Deze onRefreshToken
is zelf een async functie en returnt dus een promise.
Dus wanneer queryClient.resetQueries()
een error throwt, wordt die nu gerethrowt en kan die worden afgevangen op de plaats waar onRefreshToken wordt aangeroepen met onRefreshToken().catch()
, in plaats van dat die stilletjes verdwijnt naar de window.onunhandledrejection handler.
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.
Oke duidelijk
…) is iets mee moet/kan. + Review comments, use await on resetQueries instead of finally
Deployment gebeurt (als het goed is) automatisch wanneer in Github een Release wordt aangemaakt en gepublished.