chore(metrics): add metric when we finally get to the app (#16856)

Fixes #16803 and #16804

When we finally do the call to go to the main app, we check if we were doing a login or an onboarding and then send a metric (if enabled)
This commit is contained in:
Jonathan Rainville 2024-12-04 10:00:47 -05:00 committed by GitHub
parent dc9951cfb0
commit f400a9402d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,4 +1,4 @@
import NimQml, chronicles
import NimQml, chronicles, json
import io_interface
import view, controller
@ -320,8 +320,17 @@ method emitObtainingPasswordSuccess*[T](self: Module[T], password: string) =
self.view.emitObtainingPasswordSuccess(password)
method finishAppLoading*[T](self: Module[T]) =
self.delegate.finishAppLoading()
self.delegate.appReady()
let currStateObj = self.view.currentStartupStateObj()
if not currStateObj.isNil:
var eventType = "user-logged-in"
if currStateObj.flowType() != FlowType.AppLogin:
eventType = "onboarding-completed"
singletonInstance.globalEvents.addCentralizedMetricIfEnabled(eventType,
$(%*{"flowType": currStateObj.flowType()}))
self.delegate.finishAppLoading()
method checkFetchingStatusAndProceed*[T](self: Module[T]) =
if self.view.fetchingDataModel().isEntityLoaded(FetchingFromWakuProfile):