Signed-off-by: Matt Bruce <mbrucedogs@gmail.com>
This commit is contained in:
parent
fefb6cf363
commit
7a564b2115
@ -29,13 +29,36 @@ struct ContentView: View {
|
||||
settings: settings,
|
||||
sessionKey: cameraSessionKey,
|
||||
onImageCaptured: { image in
|
||||
if settings.isAutoSaveEnabled {
|
||||
// Auto-save enabled: save immediately without showing review screen
|
||||
Task {
|
||||
// Small delay to ensure shutter sound plays before saving
|
||||
try? await Task.sleep(for: .milliseconds(200))
|
||||
|
||||
let quality = settings.photoQuality
|
||||
let result = await PhotoLibraryService.savePhotoToLibrary(image, quality: quality)
|
||||
|
||||
switch result {
|
||||
case .success:
|
||||
print("Photo auto-saved successfully")
|
||||
// Don't reset camera session for auto-save to avoid timing issues
|
||||
case .failure(let error):
|
||||
print("Failed to auto-save photo: \(error)")
|
||||
// Don't reset on failure either
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// Auto-save disabled: show review screen
|
||||
capturedPhoto = CapturedPhoto(image: image, timestamp: Date())
|
||||
showPhotoReview = true
|
||||
isSavingPhoto = false
|
||||
saveError = nil
|
||||
}
|
||||
|
||||
print("Photo captured successfully")
|
||||
}
|
||||
)
|
||||
.ignoresSafeArea() // Only camera ignores safe area to fill screen
|
||||
}
|
||||
|
||||
// Photo review overlay
|
||||
@ -52,13 +75,11 @@ struct ContentView: View {
|
||||
}
|
||||
)
|
||||
.transition(.opacity)
|
||||
.ignoresSafeArea() // Photo review also fills screen
|
||||
}
|
||||
|
||||
// Settings button overlay - positioned with safe area consideration
|
||||
VStack {
|
||||
HStack {
|
||||
Spacer()
|
||||
|
||||
}
|
||||
// Settings button overlay - respects safe area naturally
|
||||
.overlay(alignment: .topTrailing) {
|
||||
Button {
|
||||
showSettings = true
|
||||
} label: {
|
||||
@ -70,15 +91,9 @@ struct ContentView: View {
|
||||
.shadow(radius: Design.Shadow.radiusSmall)
|
||||
}
|
||||
.accessibilityLabel("Settings")
|
||||
}
|
||||
.padding(.horizontal, Design.Spacing.large)
|
||||
.padding(.top, Design.Spacing.small) // Reduced from medium to account for safe area
|
||||
|
||||
Spacer()
|
||||
.padding(.top, Design.Spacing.small)
|
||||
}
|
||||
.safeAreaInset(edge: .top) { Color.clear.frame(height: 0) } // Ensures proper safe area handling
|
||||
}
|
||||
.ignoresSafeArea()
|
||||
.animation(.easeInOut(duration: Design.Animation.quick), value: showPhotoReview)
|
||||
.onChange(of: settings.isRingLightEnabled) { _, newValue in
|
||||
if settings.isFlashSyncedWithRingLight {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user