Improve progress updating, fix warnings

This commit is contained in:
Christoph Hagen
2025-01-31 14:52:20 +01:00
parent 3dc5674a3a
commit 92e1eacf57
9 changed files with 154 additions and 144 deletions

View File

@@ -2,9 +2,8 @@ import SwiftUI
struct ClassifierDownloadView: View {
@ObservedObject
var progress: Database.ClassifierProgress
let progress: ClassifierProgress
var body: some View {
VStack {
ProgressView("Downloading classifier...", value: progress.bytesLoaded, total: Double(progress.total))
@@ -19,5 +18,8 @@ struct ClassifierDownloadView: View {
}
#Preview {
ClassifierDownloadView(progress: .init(bytesLoaded: 12_300_000, total: 24_500_000))
ClassifierDownloadView(progress: .init(
bytesLoaded: 12_300_000,
total: 24_500_000)
)
}