1
0
Fork 0
mirror of https://github.com/anyproto/anytype-kotlin.git synced 2025-06-08 05:47:05 +09:00

DROID-3572 Primitives | Type screen, set back new plus button (#2323)

This commit is contained in:
Konstantin Ivanov 2025-04-15 21:41:25 +02:00 committed by GitHub
parent 1d93e4c8b9
commit 5fbd243577
Signed by: github
GPG key ID: B5690EEEBB952194
2 changed files with 10 additions and 6 deletions

View file

@ -788,8 +788,8 @@ open class ObjectSetFragment :
private fun setupNewButtonsForTypeSet(isCreateObjectAllowed: Boolean) {
if (isCreateObjectAllowed) {
addNewButton.visible()
addNewIconButton.gone()
addNewButton.gone()
addNewIconButton.visible()
} else {
addNewButton.gone()
addNewIconButton.gone()

View file

@ -1238,10 +1238,13 @@ class ObjectSetViewModel(
}
}
private suspend fun proceedWithCreatingObjectTypeSetObject(currentState: ObjectState.DataView.TypeSet) {
private suspend fun proceedWithCreatingObjectTypeSetObject(
currentState: ObjectState.DataView.TypeSet,
templateChosenBy: String?
) {
val objectType = storeOfObjectTypes.get(vmParams.ctx)
val objectTypeUniqueKey = objectType?.uniqueKey ?:return
val objectTypeUniqueKey = objectType?.uniqueKey ?: return
if (objectTypeUniqueKey == ObjectTypeIds.BOOKMARK) {
dispatch(
@ -1263,7 +1266,7 @@ class ObjectSetViewModel(
CreateDataViewObject.Params.SetByType(
type = TypeKey(objectTypeUniqueKey),
filters = viewer.filters,
template = objectType.defaultTemplateId,
template = templateChosenBy ?: objectType.defaultTemplateId,
prefilled = prefilled
)
)
@ -2917,7 +2920,8 @@ class ObjectSetViewModel(
is ObjectState.DataView.TypeSet -> {
proceedWithCreatingObjectTypeSetObject(
currentState = state
currentState = state,
templateChosenBy = templateId
)
}
}