mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 16:10:20 +00:00
Allow the mac app to chose room avatars directly from files instead of the photo library
This commit is contained in:
+1
-1
@@ -53,7 +53,7 @@ final class UserDetailsEditScreenCoordinator: CoordinatorProtocol {
|
||||
case .displayMediaPicker:
|
||||
displayMediaPickerWithMode(.init(source: .photoLibrary, selectionType: .single))
|
||||
case .displayFilePicker:
|
||||
displayMediaPickerWithMode(.init(source: .documents, selectionType: .single))
|
||||
displayMediaPickerWithMode(.init(source: .documents(types: [.image]), selectionType: .single))
|
||||
}
|
||||
}
|
||||
.store(in: &cancellables)
|
||||
|
||||
+1
@@ -67,5 +67,6 @@ enum UserDetailsEditScreenViewAction {
|
||||
case presentMediaSource
|
||||
case displayCameraPicker
|
||||
case displayMediaPicker
|
||||
case displayFilePicker
|
||||
case removeImage
|
||||
}
|
||||
|
||||
+2
@@ -77,6 +77,8 @@ class UserDetailsEditScreenViewModel: UserDetailsEditScreenViewModelType, UserDe
|
||||
actionsSubject.send(.displayCameraPicker)
|
||||
case .displayMediaPicker:
|
||||
actionsSubject.send(.displayMediaPicker)
|
||||
case .displayFilePicker:
|
||||
actionsSubject.send(.displayFilePicker)
|
||||
case .removeImage:
|
||||
state.localMedia = nil
|
||||
state.selectedAvatarURL = nil
|
||||
|
||||
+7
@@ -96,12 +96,19 @@ struct UserDetailsEditScreen: View {
|
||||
} label: {
|
||||
Text(L10n.actionTakePhoto)
|
||||
}
|
||||
|
||||
Button {
|
||||
context.send(viewAction: .displayMediaPicker)
|
||||
} label: {
|
||||
Text(L10n.actionChoosePhoto)
|
||||
}
|
||||
|
||||
Button {
|
||||
context.send(viewAction: .displayFilePicker)
|
||||
} label: {
|
||||
Text(L10n.actionChooseFile)
|
||||
}
|
||||
|
||||
if context.viewState.showDeleteImageAction {
|
||||
Button(role: .destructive) {
|
||||
context.send(viewAction: .removeImage)
|
||||
|
||||
Reference in New Issue
Block a user