mirror of
https://github.com/anyproto/anytype-kotlin.git
synced 2025-06-08 05:47:05 +09:00
DROID-1729 Sets or Collections | Fix | Fix broken logic for searching relations for data view sorts (#371)
This commit is contained in:
parent
0e62ab2055
commit
1652dc1b4c
2 changed files with 18 additions and 5 deletions
|
@ -14,7 +14,11 @@ import com.anytypeio.anytype.R
|
|||
import com.anytypeio.anytype.core_models.Id
|
||||
import com.anytypeio.anytype.core_ui.features.sets.SearchRelationAdapter
|
||||
import com.anytypeio.anytype.core_ui.reactive.textChanges
|
||||
import com.anytypeio.anytype.core_utils.ext.*
|
||||
import com.anytypeio.anytype.core_utils.ext.arg
|
||||
import com.anytypeio.anytype.core_utils.ext.drawable
|
||||
import com.anytypeio.anytype.core_utils.ext.invisible
|
||||
import com.anytypeio.anytype.core_utils.ext.subscribe
|
||||
import com.anytypeio.anytype.core_utils.ext.visible
|
||||
import com.anytypeio.anytype.core_utils.ui.BaseBottomSheetTextInputFragment
|
||||
import com.anytypeio.anytype.databinding.FragmentSelectSortOrFilterRelationBinding
|
||||
import com.anytypeio.anytype.di.common.componentManager
|
||||
|
@ -75,6 +79,16 @@ class SelectSortRelationFragment : BaseBottomSheetTextInputFragment<FragmentSele
|
|||
}
|
||||
}
|
||||
|
||||
override fun onStart() {
|
||||
super.onStart()
|
||||
vm.onStart(viewer)
|
||||
}
|
||||
|
||||
override fun onStop() {
|
||||
super.onStop()
|
||||
vm.onStop()
|
||||
}
|
||||
|
||||
override fun onActivityCreated(savedInstanceState: Bundle?) {
|
||||
super.onActivityCreated(savedInstanceState)
|
||||
with(lifecycleScope) {
|
||||
|
|
|
@ -3,6 +3,7 @@ package com.anytypeio.anytype.presentation.sets
|
|||
import androidx.lifecycle.viewModelScope
|
||||
import com.anytypeio.anytype.core_models.Id
|
||||
import com.anytypeio.anytype.core_models.Relations
|
||||
import com.anytypeio.anytype.core_utils.ext.cancel
|
||||
import com.anytypeio.anytype.core_utils.ext.withLatestFrom
|
||||
import com.anytypeio.anytype.domain.objects.StoreOfRelations
|
||||
import com.anytypeio.anytype.presentation.common.BaseListViewModel
|
||||
|
@ -44,8 +45,7 @@ abstract class SearchRelationViewModel(
|
|||
objectState = objectState.value,
|
||||
viewerId = viewerId,
|
||||
storeOfRelations = storeOfRelations
|
||||
)
|
||||
.filterNot { notAllowedRelations(it) }
|
||||
).filterNot { notAllowedRelations(it) }
|
||||
}
|
||||
// Searching and mapping views based on query changes.
|
||||
jobs += viewModelScope.launch {
|
||||
|
@ -73,8 +73,7 @@ abstract class SearchRelationViewModel(
|
|||
}
|
||||
|
||||
fun onStop() {
|
||||
jobs.forEach { it.cancel() }
|
||||
jobs.clear()
|
||||
jobs.cancel()
|
||||
}
|
||||
|
||||
protected open suspend fun filterRelationsFromAlreadyInUse(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue