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:
parent
1d93e4c8b9
commit
5fbd243577
2 changed files with 10 additions and 6 deletions
|
@ -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()
|
||||
|
|
|
@ -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
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue