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

Use rememberCoroutineScope in AsyncImagePainter. #2220

Merged
merged 1 commit into from
Jun 23, 2024

Conversation

colinrtwhite
Copy link
Member

Fixes #2181.

@colinrtwhite colinrtwhite force-pushed the colin/async_image_painter_scope branch from 5791917 to a7afc26 Compare June 23, 2024 14:24
@colinrtwhite colinrtwhite merged commit e2586bc into main Jun 23, 2024
8 checks passed
@colinrtwhite colinrtwhite deleted the colin/async_image_painter_scope branch June 23, 2024 15:34
Comment on lines +197 to +200
set(value) {
field?.cancel()
field = value
}
Copy link
Contributor

Choose a reason for hiding this comment

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

@colinrtwhite I think here's a slight bug that causes the image to start loading later than necessary.

Because you're not checking for if(value == field) return, the onRemembered() call is first called manually and then by the Compose framework, which means that there will be two requests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AsyncImagePainter should use rememberCoroutineScope
2 participants