Merge branch 'main' of github.com:akatreyt/Feels
This commit is contained in:
@@ -324,7 +324,9 @@ struct LiveActivityRecordingView: View {
|
||||
try? FileManager.default.createDirectory(at: outputDir, withIntermediateDirectories: true)
|
||||
|
||||
exportPath = outputDir.path
|
||||
#if DEBUG
|
||||
print("📁 Exporting frames to: \(exportPath)")
|
||||
#endif
|
||||
|
||||
let target = targetStreak
|
||||
let outDir = outputDir
|
||||
@@ -359,7 +361,9 @@ struct LiveActivityRecordingView: View {
|
||||
|
||||
await MainActor.run {
|
||||
exportComplete = true
|
||||
#if DEBUG
|
||||
print("✅ Export complete! \(target) frames saved to: \(outPath)")
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,6 +9,10 @@ import SwiftUI
|
||||
import UniformTypeIdentifiers
|
||||
import StoreKit
|
||||
|
||||
private enum SettingsAnimationConstants {
|
||||
static let locationPermissionCheckDelay: TimeInterval = 1.0
|
||||
}
|
||||
|
||||
// MARK: - Settings Content View (for use in SettingsTabView)
|
||||
struct SettingsContentView: View {
|
||||
@EnvironmentObject var authManager: BiometricAuthManager
|
||||
@@ -435,7 +439,9 @@ struct SettingsContentView: View {
|
||||
widgetExportPath = await WidgetExporter.exportAllWidgets()
|
||||
isExportingWidgets = false
|
||||
if let path = widgetExportPath {
|
||||
#if DEBUG
|
||||
print("📸 Widgets exported to: \(path.path)")
|
||||
#endif
|
||||
openInFilesApp(path)
|
||||
}
|
||||
}
|
||||
@@ -488,7 +494,9 @@ struct SettingsContentView: View {
|
||||
votingLayoutExportPath = await WidgetExporter.exportAllVotingLayouts()
|
||||
isExportingVotingLayouts = false
|
||||
if let path = votingLayoutExportPath {
|
||||
#if DEBUG
|
||||
print("📸 Voting layouts exported to: \(path.path)")
|
||||
#endif
|
||||
openInFilesApp(path)
|
||||
}
|
||||
}
|
||||
@@ -541,7 +549,9 @@ struct SettingsContentView: View {
|
||||
watchExportPath = await WatchExporter.exportAllWatchViews()
|
||||
isExportingWatchViews = false
|
||||
if let path = watchExportPath {
|
||||
#if DEBUG
|
||||
print("⌚ Watch views exported to: \(path.path)")
|
||||
#endif
|
||||
openInFilesApp(path)
|
||||
}
|
||||
}
|
||||
@@ -594,7 +604,9 @@ struct SettingsContentView: View {
|
||||
insightsExportPath = await InsightsExporter.exportInsightsScreenshots()
|
||||
isExportingInsights = false
|
||||
if let path = insightsExportPath {
|
||||
#if DEBUG
|
||||
print("✨ Insights exported to: \(path.path)")
|
||||
#endif
|
||||
openInFilesApp(path)
|
||||
}
|
||||
}
|
||||
@@ -654,7 +666,9 @@ struct SettingsContentView: View {
|
||||
sharingExportPath = await SharingScreenshotExporter.exportAllSharingScreenshots()
|
||||
isGeneratingScreenshots = false
|
||||
if let path = sharingExportPath {
|
||||
#if DEBUG
|
||||
print("📸 Sharing screenshots exported to: \(path.path)")
|
||||
#endif
|
||||
openInFilesApp(path)
|
||||
}
|
||||
}
|
||||
@@ -970,7 +984,9 @@ struct SettingsContentView: View {
|
||||
AnalyticsManager.shared.track(.healthKitNotAuthorized)
|
||||
}
|
||||
} catch {
|
||||
#if DEBUG
|
||||
print("HealthKit authorization failed: \(error)")
|
||||
#endif
|
||||
AnalyticsManager.shared.track(.healthKitEnableFailed)
|
||||
}
|
||||
}
|
||||
@@ -1068,7 +1084,7 @@ struct SettingsContentView: View {
|
||||
LocationManager.shared.requestAuthorization()
|
||||
// Check if permission was denied after a brief delay
|
||||
Task {
|
||||
try? await Task.sleep(for: .seconds(1))
|
||||
try? await Task.sleep(for: .seconds(SettingsAnimationConstants.locationPermissionCheckDelay))
|
||||
let status = LocationManager.shared.authorizationStatus
|
||||
if status == .denied || status == .restricted {
|
||||
weatherEnabled = false
|
||||
@@ -1497,9 +1513,13 @@ struct SettingsView: View {
|
||||
switch result {
|
||||
case .success(let url):
|
||||
AnalyticsManager.shared.track(.dataExported(format: "file", count: 0))
|
||||
#if DEBUG
|
||||
print("Saved to \(url)")
|
||||
#endif
|
||||
case .failure(let error):
|
||||
#if DEBUG
|
||||
print(error.localizedDescription)
|
||||
#endif
|
||||
}
|
||||
})
|
||||
.fileImporter(isPresented: $showingImporter, allowedContentTypes: [.text],
|
||||
@@ -1540,8 +1560,10 @@ struct SettingsView: View {
|
||||
} catch {
|
||||
// Handle failure.
|
||||
AnalyticsManager.shared.track(.importFailed(error: error.localizedDescription))
|
||||
#if DEBUG
|
||||
print("Unable to read file contents")
|
||||
print(error.localizedDescription)
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1681,7 +1703,9 @@ struct SettingsView: View {
|
||||
AnalyticsManager.shared.track(.healthKitNotAuthorized)
|
||||
}
|
||||
} catch {
|
||||
#if DEBUG
|
||||
print("HealthKit authorization failed: \(error)")
|
||||
#endif
|
||||
AnalyticsManager.shared.track(.healthKitEnableFailed)
|
||||
}
|
||||
}
|
||||
@@ -1771,7 +1795,7 @@ struct SettingsView: View {
|
||||
LocationManager.shared.requestAuthorization()
|
||||
// Check if permission was denied after a brief delay
|
||||
Task {
|
||||
try? await Task.sleep(for: .seconds(1))
|
||||
try? await Task.sleep(for: .seconds(SettingsAnimationConstants.locationPermissionCheckDelay))
|
||||
let status = LocationManager.shared.authorizationStatus
|
||||
if status == .denied || status == .restricted {
|
||||
weatherEnabled = false
|
||||
@@ -2332,9 +2356,13 @@ struct SettingsView: View {
|
||||
let url = URL(fileURLWithPath: path)
|
||||
do {
|
||||
try image.jpegData(compressionQuality: 1.0)?.write(to: url, options: .atomic)
|
||||
#if DEBUG
|
||||
print(url)
|
||||
#endif
|
||||
} catch {
|
||||
#if DEBUG
|
||||
print(error.localizedDescription)
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user