Skip to content

Commit

Permalink
Fix double arrow trend image not appearing on widget (#694)
Browse files Browse the repository at this point in the history
  • Loading branch information
SwiftlyNoah authored Aug 9, 2024
1 parent c80c8bb commit 2cf145e
Showing 1 changed file with 3 additions and 23 deletions.
26 changes: 3 additions & 23 deletions Loop Widget Extension/Components/GlucoseView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@ struct GlucoseView: View {
.font(.system(size: 24, weight: .heavy, design: .default))
}

if let trendImageName = getArrowImage() {
Image(systemName: trendImageName)
if let trendImage = entry.sensor?.trendType?.image {
Image(uiImage: trendImage)
.renderingMode(.template)
}
}
.foregroundColor(entry.glucoseStatusIsStale ? .staleGray : .primary)
Expand All @@ -52,25 +53,4 @@ struct GlucoseView: View {
}
}
}

private func getArrowImage() -> String? {
switch entry.sensor?.trendType {
case .upUpUp:
return "arrow.double.up.circle"
case .upUp:
return "arrow.up.circle"
case .up:
return "arrow.up.right.circle"
case .flat:
return "arrow.right.circle"
case .down:
return "arrow.down.right.circle"
case .downDown:
return "arrow.down.circle"
case .downDownDown:
return "arrow.double.down.circle"
case .none:
return nil
}
}
}

0 comments on commit 2cf145e

Please sign in to comment.