Skip to content

Commit

Permalink
Merge pull request #191 from makinosp/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
makinosp authored Nov 11, 2024
2 parents 7dd1ba5 + 4237027 commit e61055d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 10 deletions.
23 changes: 14 additions & 9 deletions harmonie/Components/URLImage/URLImage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,20 @@ struct URLImage<S>: View where S: Shape {

private func lazyImage(url: URL?, placeholder: @escaping () -> some View) -> some View {
LazyImage(url: url) { state in
if let image = state.image {
image
.resizable()
.scaledToFill()
} else if url != nil && state.error != nil {
placeholder()
.overlay(IconSet.photo.icon)
} else {
placeholder()
Group {
if let image = state.image {
image
.resizable()
.scaledToFill()
} else {
placeholder()
}
}
.overlay {
if url != nil && state.error != nil {
IconSet.photo.icon
.foregroundStyle(.gray)
}
}
}
.onCompletion { _ in
Expand Down
4 changes: 3 additions & 1 deletion harmonie/Views/MainTabView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,12 @@ extension MainTabView {
switch scenePhase {
case .active:
restoreUserData()
Task { await fetchFriendsTask() }
Task { await fetchFavoritesTask() }
case .background, .inactive:
guard let user = appVM.user else { return }
userData = user.rawValue
@unknown default: break
default: break
}
}

Expand Down

0 comments on commit e61055d

Please sign in to comment.