mirror of
https://github.com/anyproto/anytype-kotlin.git
synced 2025-06-08 05:47:05 +09:00
DROID-580 Sets | Fix | Incorrect subscription id from subscription channel breaks subscription index (#2683)
This commit is contained in:
parent
5342712b14
commit
dd30b3e234
3 changed files with 21 additions and 11 deletions
|
@ -68,7 +68,7 @@ class MiddlewareSubscriptionEventChannel(
|
|||
if (subscriptions.any { it == event.subId || "$it$DEPENDENT_SUBSCRIPTION_POST_FIX" == event.subId }) {
|
||||
SubscriptionEvent.Remove(
|
||||
target = event.id,
|
||||
subscription = payload.contextId
|
||||
subscription = event.subId
|
||||
)
|
||||
} else {
|
||||
null
|
||||
|
@ -82,7 +82,7 @@ class MiddlewareSubscriptionEventChannel(
|
|||
SubscriptionEvent.Add(
|
||||
target = event.id,
|
||||
afterId = event.afterId,
|
||||
subscription = payload.contextId
|
||||
subscription = event.subId
|
||||
)
|
||||
} else {
|
||||
null
|
||||
|
|
|
@ -12,6 +12,7 @@ import com.anytypeio.anytype.presentation.sets.filter.CreateFilterView
|
|||
import com.anytypeio.anytype.presentation.sets.filter.ViewerFilterViewModel
|
||||
import com.anytypeio.anytype.presentation.sets.model.FilterValue
|
||||
import com.anytypeio.anytype.presentation.sets.model.Viewer
|
||||
import timber.log.Timber
|
||||
|
||||
fun Viewer.Filter.Condition.hasValue(): Boolean = when (this) {
|
||||
is Viewer.Filter.Condition.Selected.Empty,
|
||||
|
@ -66,11 +67,17 @@ fun List<DVFilter>.toView(
|
|||
details: Map<Id, Block.Fields>,
|
||||
screenState: ViewerFilterViewModel.ScreenState,
|
||||
urlBuilder: UrlBuilder
|
||||
) = map { filter ->
|
||||
filter.toView(
|
||||
relation = relations.first { it.key == filter.relationKey },
|
||||
details = details,
|
||||
isInEditMode = screenState == ViewerFilterViewModel.ScreenState.EDIT,
|
||||
urlBuilder = urlBuilder
|
||||
)
|
||||
) = mapNotNull { filter ->
|
||||
val relation = relations.find { it.key == filter.relationKey }
|
||||
if (relation != null) {
|
||||
filter.toView(
|
||||
relation = relation,
|
||||
details = details,
|
||||
isInEditMode = screenState == ViewerFilterViewModel.ScreenState.EDIT,
|
||||
urlBuilder = urlBuilder
|
||||
)
|
||||
} else {
|
||||
Timber.w("Could not found relation: ${filter.relationKey} for filter: $filter")
|
||||
null
|
||||
}
|
||||
}
|
|
@ -11,12 +11,12 @@ import com.anytypeio.anytype.core_models.ObjectType
|
|||
import com.anytypeio.anytype.core_models.ObjectWrapper
|
||||
import com.anytypeio.anytype.core_models.Relation
|
||||
import com.anytypeio.anytype.core_models.Relations
|
||||
import com.anytypeio.anytype.core_models.ThemeColor
|
||||
import com.anytypeio.anytype.domain.config.DebugSettings
|
||||
import com.anytypeio.anytype.domain.misc.UrlBuilder
|
||||
import com.anytypeio.anytype.domain.objects.ObjectStore
|
||||
import com.anytypeio.anytype.presentation.dashboard.DashboardView
|
||||
import com.anytypeio.anytype.presentation.editor.editor.Markup
|
||||
import com.anytypeio.anytype.core_models.ThemeColor
|
||||
import com.anytypeio.anytype.domain.objects.ObjectStore
|
||||
import com.anytypeio.anytype.presentation.editor.editor.mention.createMentionMarkup
|
||||
import com.anytypeio.anytype.presentation.editor.editor.model.Alignment
|
||||
import com.anytypeio.anytype.presentation.editor.editor.model.BlockView
|
||||
|
@ -35,6 +35,7 @@ import com.anytypeio.anytype.presentation.sets.model.SimpleRelationView
|
|||
import com.anytypeio.anytype.presentation.sets.model.SortingExpression
|
||||
import com.anytypeio.anytype.presentation.sets.model.Viewer
|
||||
import com.anytypeio.anytype.presentation.settings.EditorSettings
|
||||
import timber.log.Timber
|
||||
|
||||
fun Block.Content.File.toPictureView(
|
||||
id: String,
|
||||
|
@ -690,6 +691,8 @@ suspend fun List<Id>.toGridRecordRows(
|
|||
details = details
|
||||
)
|
||||
rows.add(row)
|
||||
} else {
|
||||
Timber.w("Could not found record with id: $id")
|
||||
}
|
||||
}
|
||||
return rows
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue