Skip to content
Merged
4 changes: 2 additions & 2 deletions Anytype/Sources/Helpers/MailUrl/MailUrlComposer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ protocol MailUrlBuilderProtocol {
final class MailUrlBuilder: MailUrlBuilderProtocol {
@Injected(\.accountManager)
private var accountManager: any AccountManagerProtocol
@Injected(\.accountParticipantsStorage)
private var accountParticipantsStorage: any AccountParticipantsStorageProtocol
@Injected(\.participantsStorage)
private var accountParticipantsStorage: any ParticipantsStorageProtocol

nonisolated init() { }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ final class BaseDocument: BaseDocumentProtocol, @unchecked Sendable {
private var historyVersionsService: any HistoryVersionsServiceProtocol
private let propertyDetailsStorage: any PropertyDetailsStorageProtocol
private let objectTypeProvider: any ObjectTypeProviderProtocol
private let accountParticipantsStorage: any AccountParticipantsStorageProtocol
private let accountParticipantsStorage: any ParticipantsStorageProtocol
private let viewModelSetter: any DocumentViewModelSetterProtocol

private let basicUserInfoStorage: any BasicUserInfoStorageProtocol = Container.shared.basicUserInfoStorage()
Expand Down Expand Up @@ -71,7 +71,7 @@ final class BaseDocument: BaseDocumentProtocol, @unchecked Sendable {
objectLifecycleService: some ObjectLifecycleServiceProtocol,
propertyDetailsStorage: some PropertyDetailsStorageProtocol,
objectTypeProvider: some ObjectTypeProviderProtocol,
accountParticipantsStorage: some AccountParticipantsStorageProtocol,
accountParticipantsStorage: some ParticipantsStorageProtocol,
eventsListener: some EventsListenerProtocol,
viewModelSetter: some DocumentViewModelSetterProtocol,
infoContainer: some InfoContainerProtocol,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ final class SoulViewModel: ObservableObject {
private var accountManager: any AccountManagerProtocol
@Injected(\.objectActionsService)
private var objectActionsService: any ObjectActionsServiceProtocol
@Injected(\.accountParticipantsStorage)
private var accountParticipantStorage: any AccountParticipantsStorageProtocol
@Injected(\.participantsStorage)
private var accountParticipantStorage: any ParticipantsStorageProtocol

init(state: JoinFlowState, output: (any JoinFlowStepOutput)?) {
self.state = state
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ final class GlobalSearchViewModel: ObservableObject {
private var searchWithMetaModelBuilder: any SearchWithMetaModelBuilderProtocol
@Injected(\.globalSearchSavedStatesService)
private var globalSearchSavedStatesService: any GlobalSearchSavedStatesServiceProtocol
@Injected(\.accountParticipantsStorage)
private var accountParticipantStorage: any AccountParticipantsStorageProtocol
@Injected(\.participantsStorage)
private var accountParticipantStorage: any ParticipantsStorageProtocol
@Injected(\.objectActionsService)
private var objectActionService: any ObjectActionsServiceProtocol

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ struct ObjectIconExample: View {
private let emojiExamples: [CGFloat] = [16, 18, 20, 40, 48, 64, 80, 96]
@Injected(\.searchService)
private var searchService: any SearchServiceProtocol
@Injected(\.workspaceStorage)
private var workspaceStorage: any WorkspacesStorageProtocol
@Injected(\.spaceViewsStorage)
private var workspaceStorage: any SpaceViewsStorageProtocol
@State private var iconId: String = ""

var body: some View {
Expand Down Expand Up @@ -59,7 +59,7 @@ struct ObjectIconExample: View {
}
}
.task {
guard let spaceId = workspaceStorage.activeWorkspaces.first?.targetSpaceId else { return }
guard let spaceId = workspaceStorage.activeSpaceViews.first?.targetSpaceId else { return }
let files = try? await searchService.searchImages(spaceId: spaceId)
iconId = files?.first?.iconImage ?? ""
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ final class SpaceHubCoordinatorViewModel: ObservableObject, SpaceHubModuleOutput
@Published var currentSpaceId: String?
var spaceInfo: AccountInfo? {
guard let currentSpaceId else { return nil }
return workspaceStorage.workspaceInfo(spaceId: currentSpaceId)
return workspaceStorage.spaceInfo(spaceId: currentSpaceId)
}

var fallbackSpaceId: String? {
Expand Down Expand Up @@ -82,8 +82,8 @@ final class SpaceHubCoordinatorViewModel: ObservableObject, SpaceHubModuleOutput
private var activeSpaceManager: any ActiveSpaceManagerProtocol
@Injected(\.documentsProvider)
private var documentsProvider: any DocumentsProviderProtocol
@Injected(\.workspaceStorage)
private var workspaceStorage: any WorkspacesStorageProtocol
@Injected(\.spaceViewsStorage)
private var workspaceStorage: any SpaceViewsStorageProtocol
@Injected(\.userDefaultsStorage)
private var userDefaults: any UserDefaultsStorageProtocol
@Injected(\.objectTypeProvider)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ final class SpaceLoadingContainerViewModel: ObservableObject {

@Injected(\.activeSpaceManager)
private var activeSpaceManager: any ActiveSpaceManagerProtocol
private let workspacesStorage: any WorkspacesStorageProtocol = Container.shared.workspaceStorage()
private let workspacesStorage: any SpaceViewsStorageProtocol = Container.shared.spaceViewsStorage()

let spaceId: String
let showBackground: Bool
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ final class BinListViewModel: ObservableObject, OptionsItemProvider {
private var binSubscriptionService: any BinSubscriptionServiceProtocol
@Injected(\.searchService)
private var searchService: any SearchServiceProtocol
@Injected(\.accountParticipantsStorage)
private var accountParticipantStorage: any AccountParticipantsStorageProtocol
@Injected(\.participantsStorage)
private var accountParticipantStorage: any ParticipantsStorageProtocol
@Injected(\.objectActionsService)
private var objectActionService: any ObjectActionsServiceProtocol

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ final class ChatViewModel: ObservableObject, MessageModuleOutput, ChatActionProv

@Injected(\.blockService)
private var blockService: any BlockServiceProtocol
@Injected(\.accountParticipantsStorage)
private var accountParticipantsStorage: any AccountParticipantsStorageProtocol
@Injected(\.participantsStorage)
private var accountParticipantsStorage: any ParticipantsStorageProtocol
@Injected(\.mentionObjectsService)
private var mentionObjectsService: any MentionObjectsServiceProtocol
@Injected(\.chatActionService)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ actor ChatMessageBuilder: ChatMessageBuilderProtocol, Sendable {
static let grouppingDateInterval: Int = 60 // seconds
}

private let accountParticipantsStorage: any AccountParticipantsStorageProtocol = Container.shared.accountParticipantsStorage()
private let accountParticipantsStorage: any ParticipantsStorageProtocol = Container.shared.participantsStorage()
private let messageTextBuilder: any MessageTextBuilderProtocol = Container.shared.messageTextBuilder()
private let workspaceStorage: any WorkspacesStorageProtocol = Container.shared.workspaceStorage()
private let workspaceStorage: any SpaceViewsStorageProtocol = Container.shared.spaceViewsStorage()

private let spaceId: String
private let chatId: String
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import AnytypeCore

@MainActor
final class ChatHeaderViewModel: ObservableObject {

@Injected(\.workspaceStorage)
private var workspaceStorage: any WorkspacesStorageProtocol
@Injected(\.spaceViewsStorage)
private var workspaceStorage: any SpaceViewsStorageProtocol
@Injected(\.syncStatusStorage)
private var syncStatusStorage: any SyncStatusStorageProtocol
@Injected(\.participantSpacesStorage)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ final class DateViewModel: ObservableObject {
private var objectDateByTimestampService: any ObjectDateByTimestampServiceProtocol
@Injected(\.objectActionsService)
private var objectActionService: any ObjectActionsServiceProtocol
@Injected(\.accountParticipantsStorage)
private var accountParticipantStorage: any AccountParticipantsStorageProtocol
@Injected(\.participantsStorage)
private var accountParticipantStorage: any ParticipantsStorageProtocol

// MARK: - State

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import Foundation
@MainActor
final class GallerySpaceSelectionViewModel: ObservableObject {

@Injected(\.workspaceStorage)
private var workspaceStorage: any WorkspacesStorageProtocol
@Injected(\.spaceViewsStorage)
private var workspaceStorage: any SpaceViewsStorageProtocol
@Injected(\.participantSpacesStorage)
private var participantSpacesStorage: any ParticipantSpacesStorageProtocol
private weak var output: (any GallerySpaceSelectionModuleOutput)?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ final class HomeWallpaperViewModel: ObservableObject {

@Injected(\.userDefaultsStorage)
private var userDefaults: any UserDefaultsStorageProtocol
@Injected(\.workspaceStorage)
private var workspaceStorage: any WorkspacesStorageProtocol
@Injected(\.spaceViewsStorage)
private var workspaceStorage: any SpaceViewsStorageProtocol

private let spaceId: String

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,6 @@ struct HomeWidgetSubmoduleView: View {
}

private var widgetData: WidgetSubmoduleData {
WidgetSubmoduleData(widgetBlockId: widgetInfo.id, widgetObject: widgetObject, homeState: $homeState, workspaceInfo: workspaceInfo, output: output)
WidgetSubmoduleData(widgetBlockId: widgetInfo.id, widgetObject: widgetObject, homeState: $homeState, spaceInfo: workspaceInfo, output: output)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ final class HomeWidgetsViewModel {
@Injected(\.objectActionsService) @ObservationIgnored
private var objectActionService: any ObjectActionsServiceProtocol
private let documentService: any OpenedDocumentsProviderProtocol = Container.shared.openedDocumentProvider()
private let workspaceStorage: any WorkspacesStorageProtocol = Container.shared.workspaceStorage()
@Injected(\.accountParticipantsStorage) @ObservationIgnored
private var accountParticipantStorage: any AccountParticipantsStorageProtocol
private let workspaceStorage: any SpaceViewsStorageProtocol = Container.shared.spaceViewsStorage()
@Injected(\.participantsStorage) @ObservationIgnored
private var accountParticipantStorage: any ParticipantsStorageProtocol
@Injected(\.homeWidgetsRecentStateManager) @ObservationIgnored
private var recentStateManager: any HomeWidgetsRecentStateManagerProtocol
@Injected(\.objectTypeProvider) @ObservationIgnored
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ final class WidgetsHeaderViewModel: ObservableObject {

// MARK: - DI

@Injected(\.workspaceStorage)
private var workspaceStorage: any WorkspacesStorageProtocol
@Injected(\.spaceViewsStorage)
private var workspaceStorage: any SpaceViewsStorageProtocol
@Injected(\.participantSpacesStorage)
private var participantSpacesStorage: any ParticipantSpacesStorageProtocol
private let onSpaceSelected: () -> Void
Expand Down Expand Up @@ -45,7 +45,7 @@ final class WidgetsHeaderViewModel: ObservableObject {
}

private func startSpaceTask() async {
for await spaces in workspaceStorage.activeWorkspsacesPublisher.values {
for await spaces in workspaceStorage.activeSpaceViewsPublisher.values {
guard let space = spaces.first(where: { $0.targetSpaceId == accountSpaceId }) else { continue }
spaceName = space.title
spaceIcon = space.objectIconImage
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ struct WidgetSubmoduleData {
let widgetBlockId: String
let widgetObject: any BaseDocumentProtocol
let homeState: Binding<HomeWidgetsState>
let workspaceInfo: AccountInfo
let spaceInfo: AccountInfo
let output: (any CommonWidgetModuleOutput)?
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ final class ObjectTypeWidgetViewModel {
private let expandedService: any ExpandedServiceProtocol
@Injected(\.objectActionsService) @ObservationIgnored
private var objectActionsService: any ObjectActionsServiceProtocol
@Injected(\.accountParticipantsStorage) @ObservationIgnored
private var accountParticipantsStorage: any AccountParticipantsStorageProtocol
@Injected(\.participantsStorage) @ObservationIgnored
private var accountParticipantsStorage: any ParticipantsStorageProtocol
private let rowsBuilder: any ObjectTypeRowsBuilderProtocol

private let info: ObjectTypeWidgetInfo
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import AnytypeCore
@MainActor
final class SpaceChatWidgetViewModel: ObservableObject {

@Injected(\.workspaceStorage)
private var workspaceStorage: any WorkspacesStorageProtocol
@Injected(\.spaceViewsStorage)
private var workspaceStorage: any SpaceViewsStorageProtocol
@Injected(\.chatMessagesPreviewsStorage)
private var chatMessagesPreviewsStorage: any ChatMessagesPreviewsStorageProtocol
@Injected(\.widgetActionsViewCommonMenuProvider)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ final class PinnedWidgetInternalViewModel: ObservableObject, WidgetInternalViewM
init(data: WidgetSubmoduleData) {
self.widgetBlockId = data.widgetBlockId
self.widgetObject = data.widgetObject
self.homeObjectId = data.workspaceInfo.homeObjectID
self.spaceId = data.workspaceInfo.accountSpaceId
self.homeObjectId = data.spaceInfo.homeObjectID
self.spaceId = data.spaceInfo.accountSpaceId
self.output = data.output

let documentService = Container.shared.openedDocumentProvider.resolve()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ final class RecentWidgetInternalViewModel: ObservableObject, WidgetInternalViewM
self.type = type
self.widgetBlockId = data.widgetBlockId
self.widgetObject = data.widgetObject
self.spaceId = data.workspaceInfo.accountSpaceId
self.spaceId = data.spaceInfo.accountSpaceId
self.name = type.title
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ final class PublishToWebViewModel: ObservableObject {

@Injected(\.publishingService)
private var publishingService: any PublishingServiceProtocol
@Injected(\.accountParticipantsStorage)
private var participantStorage: any AccountParticipantsStorageProtocol
@Injected(\.participantsStorage)
private var participantStorage: any ParticipantsStorageProtocol
@Injected(\.documentsProvider)
private var documentsProvider: any DocumentsProviderProtocol
@Injected(\.workspaceStorage)
private var activeWorkspaceStorage: any WorkspacesStorageProtocol
@Injected(\.spaceViewsStorage)
private var activeWorkspaceStorage: any SpaceViewsStorageProtocol

private let spaceId: String
private let objectId: String
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import SharedContentManager
@MainActor
final class SharingExtensionShareToViewModel: ObservableObject {

@Injected(\.workspaceStorage)
private var workspacesStorage: any WorkspacesStorageProtocol
@Injected(\.spaceViewsStorage)
private var workspacesStorage: any SpaceViewsStorageProtocol
@Injected(\.searchService)
private var searchService: any SearchServiceProtocol
@Injected(\.activeSpaceManager)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ final class SpaceDeleteAlertModel: ObservableObject {

@Injected(\.workspaceService)
private var workspaceService: any WorkspaceServiceProtocol
@Injected(\.workspaceStorage)
private var workspaceStorage: any WorkspacesStorageProtocol
@Injected(\.spaceViewsStorage)
private var workspaceStorage: any SpaceViewsStorageProtocol

private let spaceId: String

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ final class SpaceHubViewModel: ObservableObject {

@Injected(\.userDefaultsStorage)
private var userDefaults: any UserDefaultsStorageProtocol
@Injected(\.workspaceStorage)
private var workspacesStorage: any WorkspacesStorageProtocol
@Injected(\.spaceViewsStorage)
private var workspacesStorage: any SpaceViewsStorageProtocol
@Injected(\.spaceOrderService)
private var spaceOrderService: any SpaceOrderServiceProtocol
@Injected(\.profileStorage)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ final class SpaceJoinViewModel: ObservableObject {
private let data: SpaceJoinModuleData
@Injected(\.workspaceService)
private var workspaceService: any WorkspaceServiceProtocol
@Injected(\.workspaceStorage)
private var workspaceStorage: any WorkspacesStorageProtocol
@Injected(\.spaceViewsStorage)
private var workspaceStorage: any SpaceViewsStorageProtocol
@Injected(\.activeSpaceManager)
private var activeSpaceManager: any ActiveSpaceManagerProtocol
@Injected(\.accountManager)
Expand Down Expand Up @@ -149,7 +149,7 @@ final class SpaceJoinViewModel: ObservableObject {
state = .data

let inviteWithoutApprove = inviteView.inviteType.withoutApprove
if let spaceView = workspaceStorage.allWorkspaces.first(where: { $0.targetSpaceId == inviteView.spaceId }) {
if let spaceView = workspaceStorage.allSpaceViews.first(where: { $0.targetSpaceId == inviteView.spaceId }) {
switch spaceView.accountStatus {
case .spaceJoining:
dataState = .requestSent
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ final class SpaceShareViewModel: ObservableObject {
private var membershipStatusStorage: any MembershipStatusStorageProtocol
@Injected(\.mailUrlBuilder)
private var mailUrlBuilder: any MailUrlBuilderProtocol
@Injected(\.workspaceStorage)
private var workspacesStorage: any WorkspacesStorageProtocol
@Injected(\.spaceViewsStorage)
private var workspacesStorage: any SpaceViewsStorageProtocol

private lazy var participantsSubscription: any ParticipantsSubscriptionProtocol = Container.shared.participantSubscription(spaceId)

Expand Down Expand Up @@ -91,7 +91,7 @@ final class SpaceShareViewModel: ObservableObject {
// MARK: - Private

private func updateView() {
let workspaceInfo = workspacesStorage.workspaceInfo(spaceId: spaceId)
let workspaceInfo = workspacesStorage.spaceInfo(spaceId: spaceId)
guard let participantSpaceView, let workspaceInfo else { return }

canStopShare = participantSpaceView.canStopSharing
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ final class SpaceRequestAlertModel: ObservableObject {
private var workspaceService: any WorkspaceServiceProtocol
@Injected(\.participantService)
private var participantService: any ParticipantServiceProtocol
@Injected(\.workspaceStorage)
private var workspaceStorage: any WorkspacesStorageProtocol
@Injected(\.spaceViewsStorage)
private var workspaceStorage: any SpaceViewsStorageProtocol

private let data: SpaceRequestAlertData
private let onMembershipUpgradeTap: (MembershipUpgradeReason) -> ()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ final class NewInviteLinkViewModel: ObservableObject {
@Published var inviteType: SpaceRichIviteType?
@Published var inviteChangeConfirmation: SpaceRichIviteType?

@Injected(\.workspaceStorage)
private var workspaceStorage: any WorkspacesStorageProtocol
@Injected(\.spaceViewsStorage)
private var workspaceStorage: any SpaceViewsStorageProtocol
@Injected(\.workspaceService)
private var workspaceService: any WorkspaceServiceProtocol
@Injected(\.universalLinkParser)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import Services
@MainActor
final class SpaceTypeChangeViewModel: ObservableObject {

@Injected(\.workspaceStorage)
private var workspaceStorage: any WorkspacesStorageProtocol
@Injected(\.spaceViewsStorage)
private var workspaceStorage: any SpaceViewsStorageProtocol
@Injected(\.workspaceService)
private var workspaceService: any WorkspaceServiceProtocol

Expand Down
Loading