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

avoid using runBlocking to load categories in Settings #1364

Merged
merged 1 commit into from
Oct 24, 2024

Conversation

cuong-tran
Copy link
Contributor

SettingsLibraryScreen & SettingsDownloadScreen is using runBlocking to load categories list which will cause a bit lag while waiting for data from DB, especially for users with large library.

@AntsyLich
Copy link
Member

Just set the initial to an empty list

@cuong-tran
Copy link
Contributor Author

Just set the initial to an empty list

then how to get the categories later?

@AntsyLich
Copy link
Member

Just set the initial to an empty list

then how to get the categories later?

getCategories.subscribe() will return the full category list swiftly. unless i'm mistaken

@cuong-tran
Copy link
Contributor Author

Just set the initial to an empty list

then how to get the categories later?

getCategories.subscribe() will return the full category list swiftly. unless i'm mistaken

you are right, I forgot that part.

@cuong-tran cuong-tran force-pushed the categories-runblocking branch from f410502 to d4bed5c Compare October 24, 2024 15:11
@cuong-tran cuong-tran changed the title Using screenModel to load categories instead of runBlocking avoid using runBlocking to load categories in Settings Oct 24, 2024
@AntsyLich AntsyLich merged commit f7752a9 into mihonapp:main Oct 24, 2024
1 check passed
@cuong-tran cuong-tran deleted the categories-runblocking branch October 24, 2024 18:03
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 27, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants