-
Notifications
You must be signed in to change notification settings - Fork 500
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 Space Switcher avatars #7306
Conversation
@@ -22,14 +22,22 @@ import Foundation | |||
final class AvatarViewModel: ObservableObject { |
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.
Maybe at this stage we should rename this to AvatarLoader
/AvatarProvider
?
Codecov ReportBase: 11.97% // Head: 11.98% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## hotfix/1.9.16 #7306 +/- ##
==============================================
Coverage 11.97% 11.98%
==============================================
Files 1634 1634
Lines 161034 161045 +11
Branches 65131 65159 +28
==============================================
+ Hits 19291 19301 +10
- Misses 141101 141102 +1
Partials 642 642
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
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.
LGTM! 🎉
I'm not sure why we need both SpaceAvatarImage
and AvatarImage
.
But it isn't really related with this PR.
Yeah they could share more code for sure - at a component level its because space avatars are square and normal ones are round though. |
Fixes #7305. The view model is now injected at a top level and shared across multiple avatars so no longer works with the state being held within the model. As this is a lightweight component it seems reasonable to me to move it to an
@State
variable within the view itself.Note: Also fixes the same bug in user suggestions and possibly elsewhere in SwiftUI.