mirror of
https://github.com/yattee/yattee.git
synced 2026-05-13 10:55:03 +00:00
Delete the multi-page onboarding sheet. On first launch the app now silently imports any v1 instances from UserDefaults (splitting embedded basic-auth credentials out of the URL and into the Keychain) and then, if the device is signed in to iCloud, shows a single alert offering to enable sync. Accepting shows a blocking progress overlay until the initial upload completes.
50 lines
1.3 KiB
Swift
50 lines
1.3 KiB
Swift
//
|
|
// ICloudSyncProgressView.swift
|
|
// Yattee
|
|
//
|
|
// Blocking progress overlay shown during the first-launch iCloud sync.
|
|
//
|
|
|
|
import SwiftUI
|
|
|
|
struct ICloudSyncProgressView: View {
|
|
@Environment(\.appEnvironment) private var appEnvironment
|
|
|
|
private var cloudKitSync: CloudKitSyncEngine? { appEnvironment?.cloudKitSync }
|
|
|
|
var body: some View {
|
|
VStack(spacing: 24) {
|
|
ProgressView()
|
|
.controlSize(.large)
|
|
|
|
Text(String(localized: "onboarding.cloud.syncing.title"))
|
|
.font(.title2)
|
|
.fontWeight(.semibold)
|
|
|
|
Text(progressText)
|
|
.font(.subheadline)
|
|
.foregroundStyle(.secondary)
|
|
.multilineTextAlignment(.center)
|
|
.frame(maxWidth: 400)
|
|
}
|
|
.padding(40)
|
|
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
|
#if os(macOS)
|
|
.frame(minWidth: 420, minHeight: 260)
|
|
#endif
|
|
.interactiveDismissDisabled()
|
|
}
|
|
|
|
private var progressText: String {
|
|
if let upload = cloudKitSync?.uploadProgress {
|
|
return upload.displayText
|
|
}
|
|
return String(localized: "onboarding.cloud.syncing.preparing")
|
|
}
|
|
}
|
|
|
|
#Preview {
|
|
ICloudSyncProgressView()
|
|
.appEnvironment(.preview)
|
|
}
|