Skip to content

Commit 2cf145e

Browse files
authored
Fix double arrow trend image not appearing on widget (#694)
1 parent c80c8bb commit 2cf145e

File tree

1 file changed

+3
-23
lines changed

1 file changed

+3
-23
lines changed

Loop Widget Extension/Components/GlucoseView.swift

+3-23
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,9 @@ struct GlucoseView: View {
2929
.font(.system(size: 24, weight: .heavy, design: .default))
3030
}
3131

32-
if let trendImageName = getArrowImage() {
33-
Image(systemName: trendImageName)
32+
if let trendImage = entry.sensor?.trendType?.image {
33+
Image(uiImage: trendImage)
34+
.renderingMode(.template)
3435
}
3536
}
3637
.foregroundColor(entry.glucoseStatusIsStale ? .staleGray : .primary)
@@ -52,25 +53,4 @@ struct GlucoseView: View {
5253
}
5354
}
5455
}
55-
56-
private func getArrowImage() -> String? {
57-
switch entry.sensor?.trendType {
58-
case .upUpUp:
59-
return "arrow.double.up.circle"
60-
case .upUp:
61-
return "arrow.up.circle"
62-
case .up:
63-
return "arrow.up.right.circle"
64-
case .flat:
65-
return "arrow.right.circle"
66-
case .down:
67-
return "arrow.down.right.circle"
68-
case .downDown:
69-
return "arrow.down.circle"
70-
case .downDownDown:
71-
return "arrow.double.down.circle"
72-
case .none:
73-
return nil
74-
}
75-
}
7656
}

0 commit comments

Comments
 (0)