mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-04 19:44:05 +00:00
Fix a potential race condition when redacting a message. (#3061)
* Refactor the timeline item menu action provider. - Move it into its own struct. - Use an item, not an ID so it doesn't randomly change. - Move permissions into the room screen view model. * Use the stable ID when redacting/editing/forwarding a message. Just like we do when fetching the item in the actions menu.
This commit is contained in:
@@ -161,15 +161,15 @@ struct RoomScreenViewState: BindableState {
|
||||
var timelineViewState: TimelineViewState // check the doc before changing this
|
||||
|
||||
var ownUserID: String
|
||||
var canCurrentUserRedactOthers = false
|
||||
var canCurrentUserRedactSelf = false
|
||||
var isViewSourceEnabled: Bool
|
||||
|
||||
var canJoinCall = false
|
||||
var hasOngoingCall = false
|
||||
|
||||
var bindings: RoomScreenViewStateBindings
|
||||
|
||||
/// A closure providing the actions to show when long pressing on an item in the timeline.
|
||||
var timelineItemMenuActionProvider: (@MainActor (_ itemId: TimelineItemIdentifier) -> TimelineItemMenuActions?)?
|
||||
|
||||
/// A closure providing the associated audio player state for an item in the timeline.
|
||||
var audioPlayerStateProvider: (@MainActor (_ itemId: TimelineItemIdentifier) -> AudioPlayerState?)?
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user