Fix production crash points, actor-isolation warnings, and rebrand URLs
Remove all fatalError/force unwrap/force cast crash points from production
paths (ShowBasedOnVoteLogics, Random, ReflectApp, NoteEditorView). Fix
actor-isolation warnings by wrapping off-main-thread AnalyticsManager calls
in Task { @MainActor in } (LocalNotification) and replacing DispatchQueue
with Task.detached + MainActor.run (LiveActivityPreviewView). Update legal
URLs from feels.88oakapps.com to reflect.88oakapps.com in SettingsView.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -478,9 +478,9 @@ struct EntryDetailView: View {
|
||||
Button("Choose from Library") {
|
||||
showPhotoPicker = true
|
||||
}
|
||||
if entry.photoID != nil {
|
||||
if let photoID = entry.photoID {
|
||||
Button("Remove Photo", role: .destructive) {
|
||||
_ = PhotoManager.shared.deletePhoto(id: entry.photoID!)
|
||||
_ = PhotoManager.shared.deletePhoto(id: photoID)
|
||||
_ = DataController.shared.updatePhoto(forDate: entry.forDate, photoID: nil)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -321,9 +321,12 @@ struct LiveActivityRecordingView: View {
|
||||
exportPath = outputDir.path
|
||||
print("📁 Exporting frames to: \(exportPath)")
|
||||
|
||||
// Export frames on background queue
|
||||
DispatchQueue.global(qos: .userInitiated).async {
|
||||
for streak in 1...targetStreak {
|
||||
let target = targetStreak
|
||||
let outDir = outputDir
|
||||
let outPath = exportPath
|
||||
|
||||
Task.detached(priority: .userInitiated) {
|
||||
for streak in 1...target {
|
||||
let mood = getMoodForStreak(streak)
|
||||
|
||||
let cardView = LiveActivityCardView(
|
||||
@@ -337,21 +340,21 @@ struct LiveActivityRecordingView: View {
|
||||
|
||||
if let uiImage = renderer.uiImage {
|
||||
let filename = String(format: "frame_%04d.png", streak)
|
||||
let fileURL = outputDir.appendingPathComponent(filename)
|
||||
let fileURL = outDir.appendingPathComponent(filename)
|
||||
|
||||
if let pngData = uiImage.pngData() {
|
||||
try? pngData.write(to: fileURL)
|
||||
}
|
||||
}
|
||||
|
||||
DispatchQueue.main.async {
|
||||
await MainActor.run {
|
||||
exportProgress = streak
|
||||
}
|
||||
}
|
||||
|
||||
DispatchQueue.main.async {
|
||||
await MainActor.run {
|
||||
exportComplete = true
|
||||
print("✅ Export complete! \(targetStreak) frames saved to: \(exportPath)")
|
||||
print("✅ Export complete! \(target) frames saved to: \(outPath)")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1030,7 +1030,7 @@ struct SettingsContentView: View {
|
||||
private var eulaButton: some View {
|
||||
Button(action: {
|
||||
AnalyticsManager.shared.track(.eulaViewed)
|
||||
if let url = URL(string: "https://feels.88oakapps.com/eula.html") {
|
||||
if let url = URL(string: "https://reflect.88oakapps.com/eula.html") {
|
||||
UIApplication.shared.open(url)
|
||||
}
|
||||
}, label: {
|
||||
@@ -1049,7 +1049,7 @@ struct SettingsContentView: View {
|
||||
private var privacyButton: some View {
|
||||
Button(action: {
|
||||
AnalyticsManager.shared.track(.privacyPolicyViewed)
|
||||
if let url = URL(string: "https://feels.88oakapps.com/privacy.html") {
|
||||
if let url = URL(string: "https://reflect.88oakapps.com/privacy.html") {
|
||||
UIApplication.shared.open(url)
|
||||
}
|
||||
}, label: {
|
||||
@@ -1757,7 +1757,7 @@ struct SettingsView: View {
|
||||
private var eulaButton: some View {
|
||||
Button(action: {
|
||||
AnalyticsManager.shared.track(.eulaViewed)
|
||||
openURL(URL(string: "https://feels.88oakapps.com/eula.html")!)
|
||||
if let url = URL(string: "https://reflect.88oakapps.com/eula.html") { openURL(url) }
|
||||
}, label: {
|
||||
Text(String(localized: "settings_view_show_eula"))
|
||||
.foregroundColor(textColor)
|
||||
@@ -1772,7 +1772,7 @@ struct SettingsView: View {
|
||||
private var privacyButton: some View {
|
||||
Button(action: {
|
||||
AnalyticsManager.shared.track(.privacyPolicyViewed)
|
||||
openURL(URL(string: "https://feels.88oakapps.com/privacy.html")!)
|
||||
if let url = URL(string: "https://reflect.88oakapps.com/privacy.html") { openURL(url) }
|
||||
}, label: {
|
||||
Text(String(localized: "settings_view_show_privacy"))
|
||||
.foregroundColor(textColor)
|
||||
|
||||
Reference in New Issue
Block a user