mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 06:55:59 +00:00
Fix some SwiftLint warnings.
This commit is contained in:
@@ -129,6 +129,7 @@ class RoomFlowCoordinator: FlowCoordinatorProtocol {
|
||||
fatalError("This flow coordinator expect a route")
|
||||
}
|
||||
|
||||
// swiftlint:disable:next cyclomatic_complexity
|
||||
func handleAppRoute(_ appRoute: AppRoute, animated: Bool) {
|
||||
guard stateMachine.state != .complete else {
|
||||
fatalError("This flow coordinator is `finished` ☠️")
|
||||
|
||||
@@ -366,7 +366,9 @@ class HomeScreenViewModel: HomeScreenViewModelType, HomeScreenViewModelProtocol
|
||||
title: L10n.leaveRoomAlertSelectNewOwnerTitle,
|
||||
message: L10n.leaveRoomAlertSelectNewOwnerSubtitle,
|
||||
primaryButton: .init(title: L10n.actionCancel, role: .cancel, action: nil),
|
||||
secondaryButton: .init(title: L10n.leaveRoomAlertSelectNewOwnerAction, role: .destructive, action: { [weak self] in self?.actionsSubject.send(.transferOwnership(roomIdentifier: roomID)) }))
|
||||
secondaryButton: .init(title: L10n.leaveRoomAlertSelectNewOwnerAction, role: .destructive) { [weak self] in
|
||||
self?.actionsSubject.send(.transferOwnership(roomIdentifier: roomID))
|
||||
})
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
@@ -193,7 +193,9 @@ class RoomDetailsScreenViewModel: RoomDetailsScreenViewModelType, RoomDetailsScr
|
||||
title: L10n.leaveRoomAlertSelectNewOwnerTitle,
|
||||
message: L10n.leaveRoomAlertSelectNewOwnerSubtitle,
|
||||
primaryButton: .init(title: L10n.actionCancel, role: .cancel, action: nil),
|
||||
secondaryButton: .init(title: L10n.leaveRoomAlertSelectNewOwnerAction, role: .destructive, action: { [weak self] in self?.actionsSubject.send(.transferOwnership) }))
|
||||
secondaryButton: .init(title: L10n.leaveRoomAlertSelectNewOwnerAction, role: .destructive) { [weak self] in
|
||||
self?.actionsSubject.send(.transferOwnership)
|
||||
})
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -25,7 +25,7 @@ class RoomRolesAndPermissionsScreenViewModel: RoomRolesAndPermissionsScreenViewM
|
||||
self.roomProxy = roomProxy
|
||||
self.userIndicatorController = userIndicatorController
|
||||
self.analytics = analytics
|
||||
super.init(initialViewState: RoomRolesAndPermissionsScreenViewState(ownRole: roomProxy.membersPublisher.value.first(where: { $0.userID == roomProxy.ownUserID })?.role ?? .administrator,
|
||||
super.init(initialViewState: RoomRolesAndPermissionsScreenViewState(ownRole: roomProxy.membersPublisher.value.first { $0.userID == roomProxy.ownUserID }?.role ?? .administrator,
|
||||
permissions: initialPermissions))
|
||||
|
||||
// Automatically update the admin/moderator counts.
|
||||
|
||||
@@ -39,7 +39,7 @@ class RoomChangeRolesScreenViewModelTests: XCTestCase {
|
||||
XCTAssertEqual(context.viewState.moderators, context.viewState.visibleModerators)
|
||||
XCTAssertEqual(context.viewState.users, context.viewState.visibleUsers)
|
||||
XCTAssertEqual(context.viewState.membersWithRole.count, 3)
|
||||
XCTAssert(context.viewState.membersWithRole.first(where: { $0.id == RoomMemberProxyMock.mockModerator.userID }) != nil)
|
||||
XCTAssertNotNil(context.viewState.membersWithRole.first { $0.id == RoomMemberProxyMock.mockModerator.userID })
|
||||
XCTAssertFalse(context.viewState.hasChanges)
|
||||
XCTAssertFalse(context.viewState.isSearching)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user