Wrong copy for upgrade room message (#6003)

* Wrong copy for upgrade room message

- fixed
This commit is contained in:
Gil Eluard
2022-04-11 15:46:08 +02:00
committed by GitHub
parent 5659ea937e
commit c0f8458371
22 changed files with 133 additions and 64 deletions

View File

@@ -26,7 +26,7 @@ class RoomUpgradeService: RoomUpgradeServiceProtocol {
// MARK: Private
private let session: MXSession
private let parentSpaceId: String?
private let versionOverride: String
private var currentOperation: MXHTTPOperation?
private var didBuildSpaceGraphObserver: Any?
@@ -37,11 +37,25 @@ class RoomUpgradeService: RoomUpgradeServiceProtocol {
private(set) var errorSubject: CurrentValueSubject<Error?, Never>
private(set) var currentRoomId: String
var parentSpaceName: String? {
guard let parentId = self.parentSpaceId else {
return nil
}
guard let parent = session.spaceService?.getSpace(withId: parentId) else {
MXLog.error("[RoomUpgradeService] parentSpaceName: parent space not found.")
return nil
}
return parent.room?.displayName
}
// MARK: - Setup
init(session: MXSession, roomId: String, versionOverride: String) {
init(session: MXSession, roomId: String, parentSpaceId: String?, versionOverride: String) {
self.session = session
self.currentRoomId = roomId
self.parentSpaceId = parentSpaceId
self.versionOverride = versionOverride
self.upgradingSubject = CurrentValueSubject(false)
self.errorSubject = CurrentValueSubject(nil)

View File

@@ -23,6 +23,9 @@ class MockRoomUpgradeService: RoomUpgradeServiceProtocol {
var errorSubject: CurrentValueSubject<Error?, Never>
var upgradingSubject: CurrentValueSubject<Bool, Never>
var parentSpaceName: String? {
return "Parent space name"
}
init() {
self.errorSubject = CurrentValueSubject(nil)

View File

@@ -20,6 +20,7 @@ import Combine
@available(iOS 14.0, *)
protocol RoomUpgradeServiceProtocol {
var currentRoomId: String { get }
var parentSpaceName: String? { get }
var upgradingSubject: CurrentValueSubject<Bool, Never> { get }
var errorSubject: CurrentValueSubject<Error?, Never> { get }