-
Notifications
You must be signed in to change notification settings - Fork 45
Feature/more pro states #1651
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
Feature/more pro states #1651
Conversation
| // show a toast and go back to pro settings home screen | ||
| Toast.makeText(LocalContext.current, R.string.errorGeneric, Toast.LENGTH_LONG).show() | ||
| onBack() |
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.
Does this belong to a LaunchedEffect? I think for compose you can not assume the composition to be done only once. Because onBack is an async call under the hood, there's possible another recomposition and you'll end up with two toasts and two onBack calls.
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.
I think it's ok since we are calling onBack right after but I will still wrap it in a launchedEffect just in case
| val context = LocalContext.current | ||
|
|
||
| LaunchedEffect(Unit) { | ||
| Toast.makeText(context, R.string.errorGeneric, Toast.LENGTH_LONG).show() | ||
| onBack() | ||
| } |
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.
I think you should have LaunchedEffect testing the the state as input instead, and this should happen outside of the when
LaunchedEffect(state) {
if (state is State.Error) {
// Error stuff
}
}
More logic and UI for the pro settings page and their various form factors
Added a loading and error state for the pro settings page screens
Properly linking up to the billing api to get prices and format them for display
Gave CTAs access to the subscription state to determine whichstring to display in some cases.