1
0
Fork 0
mirror of https://github.com/anyproto/anytype-kotlin.git synced 2025-06-12 10:40:25 +09:00

DROID-929 Editor | Fix | Should not allow editing read-only-value relations via featured-relations block (#2890)

This commit is contained in:
Evgenii Kozlov 2023-02-06 16:12:33 +01:00 committed by uburoiubu
parent d2161183a3
commit 83d95f2f06

View file

@ -218,6 +218,8 @@ import com.anytypeio.anytype.presentation.util.CopyFileStatus
import com.anytypeio.anytype.presentation.util.CopyFileToCacheDirectory
import com.anytypeio.anytype.presentation.util.Dispatcher
import com.anytypeio.anytype.presentation.util.OnCopyFileToCacheAction
import java.util.*
import java.util.regex.Pattern
import kotlinx.coroutines.Job
import kotlinx.coroutines.delay
import kotlinx.coroutines.flow.MutableSharedFlow
@ -234,8 +236,6 @@ import kotlinx.coroutines.flow.map
import kotlinx.coroutines.flow.onEach
import kotlinx.coroutines.launch
import timber.log.Timber
import java.util.*
import java.util.regex.Pattern
import com.anytypeio.anytype.presentation.editor.Editor.Mode as EditorMode
class EditorViewModel(
@ -3756,8 +3756,9 @@ class EditorViewModel(
val relationId = clicked.relation.relationId
val relation = storeOfRelations.getById(relationId)
if (relation != null) {
if (relation.isReadOnly == true) {
if (relation.isReadOnly == true || relation.isReadonlyValue) {
sendToast(NOT_ALLOWED_FOR_RELATION)
return@launch
}
when (relation.format) {
Relation.Format.SHORT_TEXT,