diff --git a/Anytype/Sources/PresentationLayer/Flows/SpaceHub/SpaceHubCoordinatorViewModel.swift b/Anytype/Sources/PresentationLayer/Flows/SpaceHub/SpaceHubCoordinatorViewModel.swift index b3306d2546..9b15ff4424 100644 --- a/Anytype/Sources/PresentationLayer/Flows/SpaceHub/SpaceHubCoordinatorViewModel.swift +++ b/Anytype/Sources/PresentationLayer/Flows/SpaceHub/SpaceHubCoordinatorViewModel.swift @@ -398,12 +398,8 @@ final class SpaceHubCoordinatorViewModel: ObservableObject, SpaceHubModuleOutput currentSpaceId = spaceId - if FeatureFlags.spaceLoadingForScreen { - // This is not required. But it help to load space as fast as possible - Task { try await activeSpaceManager.setActiveSpace(spaceId: spaceId) } - } else { - try await activeSpaceManager.setActiveSpace(spaceId: spaceId) - } + // This is not required. But it help to load space as fast as possible + Task { try await activeSpaceManager.setActiveSpace(spaceId: spaceId) } return spaceView } diff --git a/Anytype/Sources/PresentationLayer/Modules/SpaceHub/SpaceHubViewModel.swift b/Anytype/Sources/PresentationLayer/Modules/SpaceHub/SpaceHubViewModel.swift index 7ef998002f..27bfc10836 100644 --- a/Anytype/Sources/PresentationLayer/Modules/SpaceHub/SpaceHubViewModel.swift +++ b/Anytype/Sources/PresentationLayer/Modules/SpaceHub/SpaceHubViewModel.swift @@ -33,8 +33,6 @@ final class SpaceHubViewModel: ObservableObject { @Injected(\.userDefaultsStorage) private var userDefaults: any UserDefaultsStorageProtocol - @Injected(\.activeSpaceManager) - private var activeSpaceManager: any ActiveSpaceManagerProtocol @Injected(\.workspaceStorage) private var workspacesStorage: any WorkspacesStorageProtocol @Injected(\.spaceOrderService) @@ -65,15 +63,8 @@ final class SpaceHubViewModel: ObservableObject { } func onSpaceTap(spaceId: String) { - if FeatureFlags.spaceLoadingForScreen { - output?.onSelectSpace(spaceId: spaceId) - UISelectionFeedbackGenerator().selectionChanged() - } else { - Task { - try await activeSpaceManager.setActiveSpace(spaceId: spaceId) - UISelectionFeedbackGenerator().selectionChanged() - } - } + output?.onSelectSpace(spaceId: spaceId) + UISelectionFeedbackGenerator().selectionChanged() } @@ -145,9 +136,7 @@ final class SpaceHubViewModel: ObservableObject { private func subscribeOnSpaces() async { for await spaces in await spaceHubSpacesStorage.spacesStream { self.spaces = spaces.sorted(by: sortSpacesForPinnedFeature) - if FeatureFlags.spaceLoadingForScreen { - showLoading = spaces.contains { $0.spaceView.isLoading } - } + showLoading = spaces.contains { $0.spaceView.isLoading } } } diff --git a/Anytype/Sources/PresentationLayer/Modules/SpaceHub/Subviews/NewSpaceCardLabel.swift b/Anytype/Sources/PresentationLayer/Modules/SpaceHub/Subviews/NewSpaceCardLabel.swift index 681ec67074..0dde93c22b 100644 --- a/Anytype/Sources/PresentationLayer/Modules/SpaceHub/Subviews/NewSpaceCardLabel.swift +++ b/Anytype/Sources/PresentationLayer/Modules/SpaceHub/Subviews/NewSpaceCardLabel.swift @@ -13,9 +13,6 @@ struct NewSpaceCardLabel: View { var body: some View { content - // Delete this line with FeatureFlags.spaceLoadingForScreen - .if(spaceData.spaceView.isLoading && !FeatureFlags.spaceLoadingForScreen) { $0.redacted(reason: .placeholder) } - .if(spaceData.spaceView.isPinned) { $0.onDrag { draggedSpace = spaceData diff --git a/Anytype/Sources/PresentationLayer/Modules/SpaceHub/Subviews/SpaceCard.swift b/Anytype/Sources/PresentationLayer/Modules/SpaceHub/Subviews/SpaceCard.swift index b602c8240a..2e9c91c5fe 100644 --- a/Anytype/Sources/PresentationLayer/Modules/SpaceHub/Subviews/SpaceCard.swift +++ b/Anytype/Sources/PresentationLayer/Modules/SpaceHub/Subviews/SpaceCard.swift @@ -32,7 +32,6 @@ struct SpaceCard: View, @preconcurrency Equatable { ) } } - .disabled(FeatureFlags.spaceLoadingForScreen ? false : spaceData.spaceView.isLoading) .contentShape([.dragPreview, .contextMenuPreview], RoundedRectangle(cornerRadius: 20, style: .continuous)) .contextMenu { menuItems.tint(Color.Text.primary) } } diff --git a/Anytype/Sources/PresentationLayer/Modules/SpaceHub/Subviews/SpaceCardLabel.swift b/Anytype/Sources/PresentationLayer/Modules/SpaceHub/Subviews/SpaceCardLabel.swift index c9dec0e1a3..fa0f4c83a0 100644 --- a/Anytype/Sources/PresentationLayer/Modules/SpaceHub/Subviews/SpaceCardLabel.swift +++ b/Anytype/Sources/PresentationLayer/Modules/SpaceHub/Subviews/SpaceCardLabel.swift @@ -46,8 +46,6 @@ struct SpaceCardLabel: View { // Optimization for fast sizeThatFits .frame(height: 80) .background(Color.Background.primary) - // Delete this line with FeatureFlags.spaceLoadingForScreen - .if(spaceData.spaceView.isLoading && !FeatureFlags.spaceLoadingForScreen) { $0.redacted(reason: .placeholder) } .contentShape([.dragPreview, .contextMenuPreview], RoundedRectangle(cornerRadius: 20, style: .continuous)) .if(spaceData.spaceView.isPinned) { diff --git a/Anytype/Sources/ServiceLayer/ActiveSpaceManager/ActiveSpaceManager.swift b/Anytype/Sources/ServiceLayer/ActiveSpaceManager/ActiveSpaceManager.swift index 652712861e..cdef93b9ae 100644 --- a/Anytype/Sources/ServiceLayer/ActiveSpaceManager/ActiveSpaceManager.swift +++ b/Anytype/Sources/ServiceLayer/ActiveSpaceManager/ActiveSpaceManager.swift @@ -107,19 +107,11 @@ actor ActiveSpaceManager: ActiveSpaceManagerProtocol, Sendable { // MARK: - Private private func handleSpaces(workspaces: [SpaceView]) async { - if FeatureFlags.spaceLoadingForScreen { - guard let activeSpaceId, - let currentView = workspaces.first(where: { $0.targetSpaceId == activeSpaceId }), - (currentView.isLoading && spaceIsLoading) || currentView.isActive else { - _ = try? await setActiveSpace(spaceId: nil) - return - } - } else { - let spaceIds = workspaces.map(\.targetSpaceId) - guard let activeSpaceId, spaceIds.contains(activeSpaceId) else { - _ = try? await setActiveSpace(spaceId: nil) - return - } + guard let activeSpaceId, + let currentView = workspaces.first(where: { $0.targetSpaceId == activeSpaceId }), + (currentView.isLoading && spaceIsLoading) || currentView.isActive else { + _ = try? await setActiveSpace(spaceId: nil) + return } } diff --git a/Modules/AnytypeCore/AnytypeCore/Generated/FeatureFlags+Flags.swift b/Modules/AnytypeCore/AnytypeCore/Generated/FeatureFlags+Flags.swift index c1544af7cb..36dbaca5a0 100644 --- a/Modules/AnytypeCore/AnytypeCore/Generated/FeatureFlags+Flags.swift +++ b/Modules/AnytypeCore/AnytypeCore/Generated/FeatureFlags+Flags.swift @@ -6,10 +6,6 @@ public extension FeatureFlags { // Static value reader - static var spaceLoadingForScreen: Bool { - value(for: .spaceLoadingForScreen) - } - static var binScreenEmptyAction: Bool { value(for: .binScreenEmptyAction) } @@ -148,7 +144,6 @@ public extension FeatureFlags { // All toggles static let features: [FeatureDescription] = [ - .spaceLoadingForScreen, .binScreenEmptyAction, .muteSpacePossibility, .addNotificationsSettings, diff --git a/Modules/AnytypeCore/AnytypeCore/Utils/FeatureFlags/FeatureDescription+Flags.swift b/Modules/AnytypeCore/AnytypeCore/Utils/FeatureFlags/FeatureDescription+Flags.swift index b5641bc875..98fea965ea 100644 --- a/Modules/AnytypeCore/AnytypeCore/Utils/FeatureFlags/FeatureDescription+Flags.swift +++ b/Modules/AnytypeCore/AnytypeCore/Utils/FeatureFlags/FeatureDescription+Flags.swift @@ -4,12 +4,6 @@ import Foundation public extension FeatureDescription { - static let spaceLoadingForScreen = FeatureDescription( - title: "Space Loading State Inside Screen", - type: .feature(author: "m@anytype.io", releaseVersion: "13"), - defaultValue: true - ) - static let binScreenEmptyAction = FeatureDescription( title: "Bin screen - empty action", type: .feature(author: "m@anytype.io", releaseVersion: "13"),