Skip to content
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

Fix blocking permission requests #314

Merged
merged 4 commits into from
Oct 3, 2023

Conversation

cyb3rko
Copy link
Contributor

@cyb3rko cyb3rko commented Oct 1, 2023

I've realized that this line

installSplashScreen().setKeepOnScreenCondition { splashScreenActive }

is blocking the UI thread until the condition is true. Because permission requests take some seconds the app is blocking for several seconds, even leading to possible app crashes.

The solution is canceling the splashScreen when requesting permissions and showing the previous "splash screen layout".
Tested on Android 13 (33) and 14 (34).

@cyb3rko
Copy link
Contributor Author

cyb3rko commented Oct 3, 2023

We have that weird behaviour again that it does not recognize Kotlin functions.
I will check that.

Edit: Downgrading Kotlin fixed it once again

jmattheis
jmattheis previously approved these changes Oct 3, 2023
Copy link
Member

@jmattheis jmattheis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good, only have one little remark.

Copy link
Member

@jmattheis jmattheis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@jmattheis jmattheis merged commit 6dd5fe4 into gotify:master Oct 3, 2023
1 check passed
@cyb3rko cyb3rko deleted the fix-permission-blocking branch October 7, 2023 10:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants