mirror of
https://github.com/yattee/yattee.git
synced 2026-08-05 23:01:28 +00:00
Fix startup crash in sideloaded builds without iCloud entitlements
Sideloading tools re-sign the app with a team that cannot register the iCloud.stream.yattee.app container, and CKContainer(identifier:) fatally traps when the entitlement is missing. Detect availability by parsing the embedded provisioning profile, skip creating any CloudKit objects when the entitlement is absent, and show an explanation in iCloud settings instead of the sync toggle.
This commit is contained in:
@@ -58,24 +58,31 @@ struct iCloudSettingsView: View {
|
||||
}
|
||||
#endif
|
||||
|
||||
SettingsFormSection(footer: "settings.icloud.footer") {
|
||||
Toggle(isOn: Binding(
|
||||
get: { settingsManager?.iCloudSyncEnabled ?? false },
|
||||
set: { newValue in
|
||||
if newValue {
|
||||
showingEnableConfirmation = true
|
||||
} else {
|
||||
showingDisableConfirmation = true
|
||||
}
|
||||
}
|
||||
)) {
|
||||
Label(String(localized: "settings.icloud.enable"), systemImage: "icloud")
|
||||
if cloudKitSync?.isCloudKitAvailable == false {
|
||||
SettingsFormSection(footer: "settings.icloud.unavailable.footer") {
|
||||
Label(String(localized: "settings.icloud.unavailable"), systemImage: "icloud.slash")
|
||||
.foregroundStyle(.secondary)
|
||||
}
|
||||
} else {
|
||||
SettingsFormSection(footer: "settings.icloud.footer") {
|
||||
Toggle(isOn: Binding(
|
||||
get: { settingsManager?.iCloudSyncEnabled ?? false },
|
||||
set: { newValue in
|
||||
if newValue {
|
||||
showingEnableConfirmation = true
|
||||
} else {
|
||||
showingDisableConfirmation = true
|
||||
}
|
||||
}
|
||||
)) {
|
||||
Label(String(localized: "settings.icloud.enable"), systemImage: "icloud")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if settingsManager?.iCloudSyncEnabled == true {
|
||||
syncCategoriesSection
|
||||
syncStatusSection
|
||||
if settingsManager?.iCloudSyncEnabled == true {
|
||||
syncCategoriesSection
|
||||
syncStatusSection
|
||||
}
|
||||
}
|
||||
}
|
||||
#if !os(tvOS)
|
||||
|
||||
Reference in New Issue
Block a user