mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 06:31:27 +00:00
remove space FFs
This commit is contained in:
@@ -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())
|
||||
|
||||
Reference in New Issue
Block a user