mirror of
https://github.com/element-hq/element-x-ios.git
synced 2025-03-10 21:39:12 +00:00
Fixes #2792 - Use the right room context in the plain composer
This commit is contained in:
parent
4d0d150f2b
commit
3017100e5e
@ -110,13 +110,6 @@ struct ComposerToolbar: View {
|
||||
RoomAttachmentPicker(context: context)
|
||||
}
|
||||
messageComposer
|
||||
.environmentObject(context)
|
||||
.onTapGesture {
|
||||
guard !composerFocused else { return }
|
||||
composerFocused = true
|
||||
}
|
||||
.padding(.leading, context.composerActionsEnabled ? 7 : 0)
|
||||
.padding(.trailing, context.composerActionsEnabled ? 4 : 0)
|
||||
}
|
||||
.opacity(context.viewState.isVoiceMessageModeActivated ? 0 : 1)
|
||||
|
||||
@ -177,7 +170,14 @@ struct ComposerToolbar: View {
|
||||
} onAppearAction: {
|
||||
context.send(viewAction: .composerAppeared)
|
||||
}
|
||||
.environmentObject(context)
|
||||
.focused($composerFocused)
|
||||
.padding(.leading, context.composerActionsEnabled ? 7 : 0)
|
||||
.padding(.trailing, context.composerActionsEnabled ? 4 : 0)
|
||||
.onTapGesture {
|
||||
guard !composerFocused else { return }
|
||||
composerFocused = true
|
||||
}
|
||||
.onChange(of: context.composerFocused) { newValue in
|
||||
guard composerFocused != newValue else { return }
|
||||
|
||||
|
@ -787,7 +787,7 @@ extension EnvironmentValues {
|
||||
get { self[RoomContextKey.self] }
|
||||
set { self[RoomContextKey.self] = newValue }
|
||||
}
|
||||
|
||||
|
||||
/// An event ID which will be non-nil when a timeline item should show as focussed.
|
||||
var focussedEventID: String? {
|
||||
get { self[FocussedEventID.self] }
|
||||
|
@ -45,7 +45,7 @@ struct RoomScreen: View {
|
||||
}
|
||||
.padding(.top, 8)
|
||||
.background(Color.compound.bgCanvasDefault.ignoresSafeArea())
|
||||
.environmentObject(context)
|
||||
.environment(\.roomContext, context)
|
||||
}
|
||||
.navigationTitle(L10n.screenRoomTitle) // Hidden but used for back button text.
|
||||
.navigationBarTitleDisplayMode(.inline)
|
||||
|
@ -27,7 +27,6 @@ class RoomPollsHistoryScreenViewModelTests: XCTestCase {
|
||||
override func setUpWithError() throws {
|
||||
interactionHandler = PollInteractionHandlerMock()
|
||||
timelineController = MockRoomTimelineController()
|
||||
let roomProxyMockConfiguration = RoomProxyMockConfiguration(name: "Polls")
|
||||
viewModel = RoomPollsHistoryScreenViewModel(pollInteractionHandler: interactionHandler,
|
||||
roomTimelineController: timelineController,
|
||||
userIndicatorController: UserIndicatorControllerMock())
|
||||
|
Loading…
x
Reference in New Issue
Block a user