mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-04 01:20:12 +00:00
Show room encryption state in the composer (#3841)
* Fixes #3835 - Show room encryption state in the composer * Update the preview test snapshots * Update the UI test snapshots.
This commit is contained in:
@@ -15,6 +15,7 @@ struct MediaUploadPreviewScreenViewState: BindableState {
|
||||
let url: URL
|
||||
let title: String?
|
||||
let shouldShowCaptionWarning: Bool
|
||||
let isRoomEncrypted: Bool
|
||||
var shouldDisableInteraction = false
|
||||
|
||||
var bindings = MediaUploadPreviewScreenBindings()
|
||||
|
||||
+4
-1
@@ -40,7 +40,10 @@ class MediaUploadPreviewScreenViewModel: MediaUploadPreviewScreenViewModelType,
|
||||
// Start processing the media whilst the user is reviewing it/adding a caption.
|
||||
processingTask = Task { await mediaUploadingPreprocessor.processMedia(at: url) }
|
||||
|
||||
super.init(initialViewState: MediaUploadPreviewScreenViewState(url: url, title: title, shouldShowCaptionWarning: shouldShowCaptionWarning))
|
||||
super.init(initialViewState: MediaUploadPreviewScreenViewState(url: url,
|
||||
title: title,
|
||||
shouldShowCaptionWarning: shouldShowCaptionWarning,
|
||||
isRoomEncrypted: roomProxy.isEncrypted))
|
||||
}
|
||||
|
||||
override func process(viewAction: MediaUploadPreviewScreenViewAction) {
|
||||
|
||||
+2
-2
@@ -69,7 +69,7 @@ struct MediaUploadPreviewScreen: View {
|
||||
captionWarningButton
|
||||
}
|
||||
}
|
||||
.messageComposerStyle()
|
||||
.messageComposerStyle(isEncrypted: context.viewState.isRoomEncrypted)
|
||||
|
||||
SendButton {
|
||||
context.send(viewAction: .send)
|
||||
@@ -228,7 +228,7 @@ struct MediaUploadPreviewScreen_Previews: PreviewProvider, TestablePreview {
|
||||
static let testURL = Bundle.main.url(forResource: "AppIcon60x60@2x", withExtension: "png")
|
||||
|
||||
static let viewModel = MediaUploadPreviewScreenViewModel(userIndicatorController: UserIndicatorControllerMock.default,
|
||||
roomProxy: JoinedRoomProxyMock(),
|
||||
roomProxy: JoinedRoomProxyMock(.init()),
|
||||
mediaUploadingPreprocessor: MediaUploadingPreprocessor(appSettings: ServiceLocator.shared.settings),
|
||||
title: "App Icon.png",
|
||||
url: snapshotURL,
|
||||
|
||||
Reference in New Issue
Block a user