mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-20 00:24:43 +02:00
Configured and applied SwiftFormat
This commit is contained in:
committed by
Stefan Ceriu
parent
ff2e6ddfa7
commit
43c28d23b7
+8
-9
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user