remove space FFs

This commit is contained in:
Mauro Romito
2026-02-26 15:45:07 +01:00
committed by Mauro
parent 737b907d26
commit ce97fec477
18 changed files with 30 additions and 100 deletions
@@ -21,9 +21,7 @@ struct SpacesScreenViewState: BindableState {
var topLevelSpaces: [SpaceServiceRoom]
var selectedSpaceID: String?
var isCreateSpaceEnabled: Bool
var bindings: SpacesScreenViewStateBindings
}
@@ -31,7 +31,6 @@ class SpacesScreenViewModel: SpacesScreenViewModelType, SpacesScreenViewModelPro
super.init(initialViewState: SpacesScreenViewState(userID: userSession.clientProxy.userID,
topLevelSpaces: spaceServiceProxy.topLevelSpacesPublisher.value,
isCreateSpaceEnabled: appSettings.createSpaceEnabled,
bindings: .init()),
mediaProvider: userSession.mediaProvider)
@@ -53,10 +52,6 @@ class SpacesScreenViewModel: SpacesScreenViewModelType, SpacesScreenViewModelPro
.receive(on: DispatchQueue.main)
.weakAssign(to: \.state.userDisplayName, on: self)
.store(in: &cancellables)
appSettings.$createSpaceEnabled
.weakAssign(to: \.state.isCreateSpaceEnabled, on: self)
.store(in: &cancellables)
}
// MARK: - Public
@@ -27,7 +27,7 @@ struct SpacesScreen: View {
@ViewBuilder
private var mainContent: some View {
if context.viewState.isCreateSpaceEnabled, context.viewState.topLevelSpaces.isEmpty {
if context.viewState.topLevelSpaces.isEmpty {
emptyState
} else {
ScrollView {
@@ -118,16 +118,14 @@ struct SpacesScreen: View {
}
.backportSharedBackgroundVisibility(.hidden)
if context.viewState.isCreateSpaceEnabled {
ToolbarItem(placement: .navigationBarTrailing) {
Button {
context.send(viewAction: .createSpace)
} label: {
CompoundIcon(\.plus)
.accessibilityHidden(true)
}
.accessibilityLabel(L10n.actionCreateSpace)
ToolbarItem(placement: .navigationBarTrailing) {
Button {
context.send(viewAction: .createSpace)
} label: {
CompoundIcon(\.plus)
.accessibilityHidden(true)
}
.accessibilityLabel(L10n.actionCreateSpace)
}
}
}
@@ -152,7 +150,6 @@ struct SpacesScreen_Previews: PreviewProvider, TestablePreview {
static func makeViewModel(isEmpty: Bool = false) -> SpacesScreenViewModel {
AppSettings.resetAllSettings()
let appSettings = AppSettings()
appSettings.createSpaceEnabled = true
appSettings.hasSeenSpacesAnnouncement = true
let clientProxy = ClientProxyMock(.init())