Fix watch fuel icons and snapshot sync

This commit is contained in:
FuelBoard Contributor
2026-08-30 23:35:59 +01:00
parent d40bcaeca0
commit 486b8cff2e
3 changed files with 34 additions and 14 deletions
+8 -11
View File
@@ -26,19 +26,13 @@ private enum WatchFuelType: String, CaseIterable, Identifiable, Codable {
var color: Color {
switch self {
case .e10: return .green
case .e5: return .yellow
case .diesel: return .blue
case .e10: return Color(red: 48/255.0, green: 209/255.0, blue: 88/255.0) // #30D158
case .e5: return Color(red: 255/255.0, green: 214/255.0, blue: 10/255.0) // #FFD60A
case .diesel: return Color(red: 100/255.0, green: 210/255.0, blue: 255/255.0) // #64D2FF
}
}
var symbol: String {
switch self {
case .e10: return "fuelpump.fill"
case .e5: return "fuelpump.circle.fill"
case .diesel: return "drop.fill"
}
}
var symbol: String { "fuelpump.fill" }
var sortRank: Int {
switch self {
@@ -297,7 +291,10 @@ struct ContentView: View {
}
}
.tabViewStyle(.verticalPage)
.onAppear(perform: reloadFromCache)
.onAppear {
reloadFromCache()
WatchSyncManager.shared.requestSnapshot()
}
.onReceive(NotificationCenter.default.publisher(for: .fuelBoardWatchDataDidUpdate)) { _ in
reloadFromCache()
}