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