Skip to content

Commit f86e23b

Browse files
authored
Merge branch 'main' into russian-localization
2 parents edcd616 + 4abd511 commit f86e23b

5 files changed

Lines changed: 12 additions & 10 deletions

File tree

InfiniLink/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
<key>NSAppleMusicUsageDescription</key>
2626
<string>This app needs permission to allow your PineTime to control your music.</string>
2727
<key>NSBluetoothAlwaysUsageDescription</key>
28-
<string>This app uses bletooth to communicate with your PineTime.</string>
28+
<string>This app uses bluetooth to communicate with your PineTime.</string>
2929
<key>NSBluetoothPeripheralUsageDescription</key>
3030
<string>This app uses bluetooth to communicate with your PineTime.</string>
3131
<key>NSDownloadsFolderUsageDescription</key>

InfiniLink/Music/MusicController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ class MusicController {
104104
}
105105

106106
func convertTime(value: Double) -> [UInt8] {
107-
let val32 : UInt32 = UInt32(floor(value))
107+
var val32 : UInt32 = UInt32(0); if value < Double(UInt32.max) && Double(UInt32.max) >= 0.0 {val32 = UInt32(floor(value))}
108108

109109
let byte1 = UInt8(val32 & 0x000000FF)
110110
let byte2 = UInt8((val32 & 0x0000FF00) >> 8)

InfiniLink/View Components/Home View/HomeScreen.swift

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -106,11 +106,9 @@ struct HomeScreen: View {
106106
Text("")
107107
}
108108
}
109-
.onChange(of: downloadManager.downloading) { _ in
110-
if !downloadManager.downloading {
111-
if downloadManager.updateAvailable {
112-
self.updateAvailable = true
113-
}
109+
.onChange(of: downloadManager.updateAvailable) { _ in
110+
if downloadManager.updateAvailable {
111+
self.updateAvailable = true
114112
}
115113
}
116114
}

InfiniLink/View Components/Sheets/ChartSettingsSheet/ChartSettingsSheetDatePicker.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ struct ChartSettingsSheetDatePicker: View {
1414
let oneMonthAgo = Calendar.current.date(byAdding: .month, value: -1, to: Date()) ?? (Date() - 2419200)
1515

1616
@Binding var chartRangeState: ChartManager.DateSelectionState
17-
let oldestPoint: Date?
17+
let oldestPoint: Date
1818

1919
var body: some View {
2020
List {
2121
DatePicker(
2222
NSLocalizedString("start_date", comment: ""),
2323
selection: $chartRangeState.startDate,
24-
in: (oldestPoint ?? oneMonthAgo)...today,
24+
in: (oldestPoint)...today,
2525
displayedComponents: [.date, .hourAndMinute]
2626
)
2727
DatePicker(

InfiniLink/View Components/Sheets/ChartSettingsSheet/ChartSettingsSheetMain.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,11 @@ struct ChartSettingsSheet: View {
8181
case 1:
8282
ChartSettingsSheetSliders(chartRangeState: self.$chartRangeState)
8383
case 2:
84-
ChartSettingsSheetDatePicker(chartRangeState: self.$chartRangeState, oldestPoint: chartPoints[0].timestamp)
84+
if chartPoints.count > 0 {
85+
ChartSettingsSheetDatePicker(chartRangeState: self.$chartRangeState, oldestPoint: chartPoints[0].timestamp!)
86+
} else {
87+
ChartSettingsSheetDatePicker(chartRangeState: self.$chartRangeState, oldestPoint: Calendar.current.date(byAdding: .month, value: -1, to: Date()) ?? (Date() - 2419200))
88+
}
8589
default:
8690
EmptyView()
8791
}

0 commit comments

Comments
 (0)