Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ private struct HomeWidgetsInternalView: View {
private var widgets: some View {
ScrollView {
VStack(spacing: 0) {
topWidgets
blockWidgets
objectTypeWidgets
AnytypeNavigationSpacer()
Expand All @@ -66,13 +65,6 @@ private struct HomeWidgetsInternalView: View {
}
}

@ViewBuilder
private var topWidgets: some View {
if let data = model.chatWidgetData {
SpaceChatWidgetView(data: data)
}
}

@ViewBuilder
private var blockWidgets: some View {
if model.widgetBlocks.isNotEmpty {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ final class HomeWidgetsViewModel {
var pinnedSectionIsExpanded: Bool = false
var objectTypeSectionIsExpanded: Bool = false
var canCreateObjectType: Bool = false
var chatWidgetData: SpaceChatWidgetData?

var spaceId: String { info.accountSpaceId }

Expand All @@ -70,9 +69,8 @@ final class HomeWidgetsViewModel {
async let widgetObjectSub: () = startWidgetObjectTask()
async let participantTask: () = startParticipantTask()
async let objectTypesTask: () = startObjectTypesTask()
async let spaceViewTask: () = startSpaceViewTask()

_ = await (widgetObjectSub, participantTask, objectTypesTask, spaceViewTask)

_ = await (widgetObjectSub, participantTask, objectTypesTask)
}

func onAppear() {
Expand Down Expand Up @@ -175,10 +173,4 @@ final class HomeWidgetsViewModel {
objectTypeWidgets = objectTypes
}
}

private func startSpaceViewTask() async {
for await showChat in workspaceStorage.spaceViewPublisher(spaceId: spaceId).map(\.canShowChatWidget).removeDuplicates().values {
chatWidgetData = showChat ? SpaceChatWidgetData(spaceId: spaceId, output: output) : nil
}
}
}

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,7 @@ extension SpaceView {
var canAddChatWidget: Bool {
!initialScreenIsChat && isShared && hasChat
}

var canShowChatWidget: Bool {
!initialScreenIsChat && hasChat
}


var hasChat: Bool {
chatId.isNotEmpty
}
Expand Down