mirror of
https://github.com/anyproto/anytype-kotlin.git
synced 2025-06-08 05:47:05 +09:00
DROID-3593 Primitives | Fix | Disable type title update when restriction is present (#2358)
This commit is contained in:
parent
fd1c45f780
commit
3b94345d5f
4 changed files with 15 additions and 0 deletions
|
@ -211,6 +211,7 @@ sealed class UiErrorState {
|
|||
|
||||
sealed class Reason {
|
||||
data class ErrorGettingObjects(val msg: String) : Reason()
|
||||
data object ErrorEditingTypeDetails : Reason()
|
||||
data class Other(val msg: String) : Reason()
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1172,6 +1172,11 @@ class ObjectTypeViewModel(
|
|||
"showTitleAndIconUpdateScreen, initialIcon: $initialIcon, " +
|
||||
"initialTitle: $initialTitle, initialPlural: $initialPlural"
|
||||
)
|
||||
val isPossibleToUpdateTitle = _objectTypePermissionsState.value?.canEditDetails == true
|
||||
if (!isPossibleToUpdateTitle) {
|
||||
errorState.value = Show(ErrorEditingTypeDetails)
|
||||
return
|
||||
}
|
||||
uiTitleAndIconUpdateState.value = UiTypeSetupTitleAndIconState.Visible.EditType(
|
||||
icon = initialIcon,
|
||||
initialTitle = initialTitle,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue