Make the attachment menu an actual menu. (#2199)

There was a bug with the sheet/popover when overriding the colour scheme where the button renders in light mode when the app is in dark mode.
This commit is contained in:
Doug
2023-12-05 11:14:16 +00:00
committed by GitHub
parent 7da881ae3e
commit 5586405c4f
14 changed files with 65 additions and 86 deletions
@@ -180,16 +180,8 @@ class RoomScreenViewModel: RoomScreenViewModelType, RoomScreenViewModelProtocol
mode: mode,
intentionalMentions: intentionalMentions)
}
case .displayCameraPicker:
actionsSubject.send(.displayCameraPicker)
case .displayMediaPicker:
actionsSubject.send(.displayMediaPicker)
case .displayDocumentPicker:
actionsSubject.send(.displayDocumentPicker)
case .displayLocationPicker:
actionsSubject.send(.displayLocationPicker)
case .displayNewPollForm:
actionsSubject.send(.displayPollForm(mode: .new))
case .attach(let attachment):
attach(attachment)
case .handlePasteOrDrop(let provider):
roomScreenInteractionHandler.handlePasteOrDrop(provider)
case .composerModeChanged(mode: let mode):
@@ -203,6 +195,21 @@ class RoomScreenViewModel: RoomScreenViewModelType, RoomScreenViewModelProtocol
// MARK: - Private
private func attach(_ attachment: ComposerAttachmentType) {
switch attachment {
case .camera:
actionsSubject.send(.displayCameraPicker)
case .photoLibrary:
actionsSubject.send(.displayMediaPicker)
case .file:
actionsSubject.send(.displayDocumentPicker)
case .location:
actionsSubject.send(.displayLocationPicker)
case .poll:
actionsSubject.send(.displayPollForm(mode: .new))
}
}
private func processPollAction(_ action: RoomScreenViewPollAction) {
switch action {
case let .selectOption(pollStartID, optionID):