commit 556a5bcf4d12b0ad7055b6b538195a9df51d1cb4
parent 6de44223f2c16354124da23f8a0e2dbce080e355
Author: kernelkind <kernelkind@gmail.com>
Date: Tue, 27 Feb 2024 22:32:35 -0500
use camera controller in EditPictureControl
Modify EditPictureControl to use the CameraController exactly as
PostView does.
Lightning-address: kernelkind@getalby.com
Signed-off-by: kernelkind <kernelkind@gmail.com>
Link: 20240228033235.66935-3-kernelkind@gmail.com
Signed-off-by: William Casarin <jb55@jb55.com>
Diffstat:
1 file changed, 3 insertions(+), 12 deletions(-)
diff --git a/damus/Views/Profile/EditPictureControl.swift b/damus/Views/Profile/EditPictureControl.swift
@@ -60,18 +60,9 @@ struct EditPictureControl: View {
}
}
.sheet(isPresented: $show_camera) {
-
- MediaPicker(image_upload_confirm: $image_upload_confirm, imagesOnly: true) { media in
- self.preUploadedMedia = media
- }
- .alert(NSLocalizedString("Are you sure you want to upload this image?", comment: "Alert message asking if the user wants to upload an image."), isPresented: $image_upload_confirm) {
- Button(NSLocalizedString("Upload", comment: "Button to proceed with uploading."), role: .none) {
- if let mediaToUpload = generateMediaUpload(preUploadedMedia) {
- self.handle_upload(media: mediaToUpload)
- self.show_camera = false
- }
- }
- Button(NSLocalizedString("Cancel", comment: "Button to cancel the upload."), role: .cancel) {}
+ CameraController(uploader: uploader) {
+ self.show_camera = false
+ self.show_library = true
}
}
.sheet(isPresented: $show_library) {