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

DROID-1744 Analytics | Fix | Send link event (#731)

This commit is contained in:
Konstantin Ivanov 2023-12-20 17:33:13 +01:00 committed by GitHub
parent 17a26c7af7
commit a1c4bad747
Signed by: github
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 0 deletions

View file

@ -87,6 +87,7 @@ object EventsDictionary {
const val objectOpenAs = "OpenAsObject "
const val objectReload = "ReloadSourceData"
const val objectDuplicate = "DuplicateObject"
const val objectCreateLink = "CreateLink"
// Blocks events
const val blockCreate = "CreateBlock"

View file

@ -202,6 +202,7 @@ import com.anytypeio.anytype.presentation.extension.sendAnalyticsBlockBackground
import com.anytypeio.anytype.presentation.extension.sendAnalyticsBlockMoveToEvent
import com.anytypeio.anytype.presentation.extension.sendAnalyticsBlockReorder
import com.anytypeio.anytype.presentation.extension.sendAnalyticsBookmarkOpen
import com.anytypeio.anytype.presentation.extension.sendAnalyticsCreateLink
import com.anytypeio.anytype.presentation.extension.sendAnalyticsGoBackEvent
import com.anytypeio.anytype.presentation.extension.sendAnalyticsMentionMenuEvent
import com.anytypeio.anytype.presentation.extension.sendAnalyticsObjectCreateEvent
@ -3191,6 +3192,7 @@ class EditorViewModel(
},
onSuccess = { result ->
orchestrator.proxies.payloads.send(result.payload)
sendAnalyticsCreateLink(analytics)
sendAnalyticsObjectCreateEvent(
analytics = analytics,
type = objectTypeView.key,

View file

@ -1961,6 +1961,15 @@ private fun getAnalyticsObjectType(
return objType?.sourceObject ?: OBJ_TYPE_CUSTOM
}
fun CoroutineScope.sendAnalyticsCreateLink(
analytics: Analytics
) {
sendEvent(
analytics = analytics,
eventName = EventsDictionary.objectCreateLink
)
}
//region Self-Hosting
fun CoroutineScope.sendAnalyticsSelectNetworkEvent(