Configured and applied SwiftFormat

This commit is contained in:
Stefan Ceriu
2022-09-27 10:17:22 +03:00
committed by Stefan Ceriu
parent ff2e6ddfa7
commit 43c28d23b7
663 changed files with 2329 additions and 2840 deletions
@@ -1,4 +1,4 @@
//
//
// Copyright 2021 New Vector Ltd
//
// Licensed under the Apache License, Version 2.0 (the "License");
@@ -14,12 +14,11 @@
// limitations under the License.
//
import Foundation
import Combine
import Foundation
import MatrixSDK
class SpaceSelectorService: SpaceSelectorServiceProtocol {
// MARK: - Properties
// MARK: Private
@@ -65,7 +64,7 @@ class SpaceSelectorService: SpaceSelectorServiceProtocol {
var itemList: [SpaceSelectorListItemData] = []
itemList.append(contentsOf: invitedSpaces)
if showHomeSpace && parentSpaceId == nil {
if showHomeSpace, parentSpaceId == nil {
itemList.append(SpaceSelectorListItemData(id: SpaceSelectorConstants.homeSpaceId, icon: Asset.Images.sideMenuActionIconFeedback.image, displayName: VectorL10n.allChatsTitle, isJoined: true))
}
itemList.append(contentsOf: joinedSpaces)
@@ -93,14 +92,14 @@ class SpaceSelectorService: SpaceSelectorServiceProtocol {
self.session = session
self.parentSpaceId = parentSpaceId
self.showHomeSpace = showHomeSpace
self.spaceListSubject = CurrentValueSubject([])
self.parentSpaceNameSubject = CurrentValueSubject(nil)
spaceListSubject = CurrentValueSubject([])
parentSpaceNameSubject = CurrentValueSubject(nil)
self.selectedSpaceId = selectedSpaceId
spaceListSubject.send(spaceList)
parentSpaceNameSubject.send(parentSpaceName)
NotificationCenter.default.addObserver(self, selector: #selector(self.spaceServiceDidUpdate), name: MXSpaceService.didBuildSpaceGraph, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(spaceServiceDidUpdate), name: MXSpaceService.didBuildSpaceGraph, object: nil)
}
@objc private func spaceServiceDidUpdate() {
@@ -108,7 +107,7 @@ class SpaceSelectorService: SpaceSelectorServiceProtocol {
}
}
fileprivate extension SpaceSelectorListItemData {
private extension SpaceSelectorListItemData {
static func itemData(with space: MXSpace, notificationCounter: MXSpaceNotificationCounter) -> SpaceSelectorListItemData? {
guard let summary = space.summary else {
return nil
@@ -116,7 +115,7 @@ fileprivate extension SpaceSelectorListItemData {
let notificationState = notificationCounter.notificationState(forSpaceWithId: space.spaceId)
return SpaceSelectorListItemData(id:summary.roomId,
return SpaceSelectorListItemData(id: summary.roomId,
avatar: summary.room.avatarData,
displayName: summary.displayname,
notificationCount: notificationState?.groupMissedDiscussionsCount ?? 0,