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

DROID-1114 Editor | Fix | Note, focus on change type (#3046)

This commit is contained in:
Konstantin Ivanov 2023-03-27 12:53:35 +02:00 committed by GitHub
parent e14ef8b66b
commit d94e1a3721
Signed by: github
GPG key ID: 4AEE18F83AFDEB23

View file

@ -4270,6 +4270,7 @@ class EditorViewModel(
proceedWithConvertingToCollection()
}
else -> {
clearFocusInCaseOfLayoutNote()
proceedWithUpdateObjectType(type = type)
sendAnalyticsObjectTypeChangeEvent(
analytics = analytics,
@ -4320,6 +4321,13 @@ class EditorViewModel(
)
}
private fun clearFocusInCaseOfLayoutNote() {
val layout = orchestrator.stores.details.current().details[context]?.layout?.toInt()
if (layout == ObjectType.Layout.NOTE.code) {
proceedWithClearingFocus()
}
}
companion object {
const val NO_SEARCH_RESULT_POSITION = -1
const val NO_SCROLL_POSITION = -1