mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 21:33:26 +00:00
Contextual menu for rooms (#842)
* Add room contextual menu * Add room context menu view actions * Add navigation to room’s detail * Show leave alert in HomeScreen * Implement leave logic * Refine leave navigation for iPad * Optimize leave from homescreen * Refactor roomSettings -> roomDetails * Refactor room for id mock * Add UTs * Cleanup * Fix alert presentation in RoomDetailsScreenViewModel * Fix animation flag
This commit is contained in:
@@ -53,9 +53,13 @@ class MockClientProxy: ClientProxyProtocol {
|
||||
.failure(.failedCreatingRoom)
|
||||
}
|
||||
|
||||
var roomInviter: RoomMemberProxyMock?
|
||||
var roomForIdentifierMocks: [String: RoomProxyMock] = .init()
|
||||
@MainActor
|
||||
func roomForIdentifier(_ identifier: String) async -> RoomProxyProtocol? {
|
||||
guard roomForIdentifierMocks[identifier] == nil else {
|
||||
return roomForIdentifierMocks[identifier]
|
||||
}
|
||||
|
||||
guard let room = visibleRoomsSummaryProvider?.roomListPublisher.value.first(where: { $0.id == identifier }) else {
|
||||
return nil
|
||||
}
|
||||
@@ -64,10 +68,7 @@ class MockClientProxy: ClientProxyProtocol {
|
||||
case .empty:
|
||||
return RoomProxyMock(with: .init(displayName: "Empty room"))
|
||||
case .filled(let details), .invalidated(let details):
|
||||
let room = RoomProxyMock(with: .init(displayName: details.name))
|
||||
room.acceptInvitationReturnValue = .success(())
|
||||
room.inviterReturnValue = roomInviter
|
||||
return room
|
||||
return RoomProxyMock(with: .init(displayName: details.name))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user