mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 06:55:59 +00:00
Clean up the Signposter implementation and align on new metrics
This commit is contained in:
committed by
Stefan Ceriu
parent
8b768f74f8
commit
a2a8527ffc
@@ -95,18 +95,15 @@ class LoginScreenViewModel: LoginScreenViewModelType, LoginScreenViewModelProtoc
|
||||
startLoading(isInteractionBlocking: true)
|
||||
|
||||
Task {
|
||||
analytics.signpost.beginLogin()
|
||||
switch await authenticationService.login(username: state.bindings.username,
|
||||
password: state.bindings.password,
|
||||
initialDeviceName: UIDevice.current.initialDeviceName,
|
||||
deviceID: nil) {
|
||||
case .success(let userSession):
|
||||
actionsSubject.send(.signedIn(userSession))
|
||||
analytics.signpost.endLogin()
|
||||
stopLoading()
|
||||
case .failure(let error):
|
||||
stopLoading()
|
||||
analytics.signpost.endLogin()
|
||||
handleError(error)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -292,8 +292,6 @@ class HomeScreenViewModel: HomeScreenViewModelType, HomeScreenViewModelProtocol
|
||||
return
|
||||
}
|
||||
|
||||
analyticsService.signpost.beginFirstRooms()
|
||||
|
||||
roomSummaryProvider.statePublisher
|
||||
.receive(on: DispatchQueue.main)
|
||||
.sink { [weak self] state in
|
||||
@@ -329,7 +327,7 @@ class HomeScreenViewModel: HomeScreenViewModelType, HomeScreenViewModelProtocol
|
||||
}
|
||||
|
||||
if roomListMode == .rooms, state.roomListMode == .skeletons {
|
||||
analyticsService.signpost.endFirstRooms()
|
||||
analyticsService.signpost.finishTransaction(.cachedRoomList)
|
||||
}
|
||||
|
||||
state.roomListMode = roomListMode
|
||||
|
||||
@@ -256,7 +256,9 @@ class TimelineViewModel: TimelineViewModelType, TimelineViewModelProtocol {
|
||||
}
|
||||
|
||||
showFocusLoadingIndicator()
|
||||
defer { hideFocusLoadingIndicator() }
|
||||
defer {
|
||||
hideFocusLoadingIndicator()
|
||||
}
|
||||
|
||||
switch await timelineController.focusOnEvent(eventID, timelineSize: Constants.detachedTimelineSize) {
|
||||
case .success:
|
||||
@@ -318,6 +320,7 @@ class TimelineViewModel: TimelineViewModelType, TimelineViewModelProtocol {
|
||||
focussedEvent.appearance = .hasAppeared
|
||||
state.timelineState.focussedEvent = focussedEvent
|
||||
hideFocusLoadingIndicator()
|
||||
analyticsService.signpost.finishTransaction(.notificationToMessage)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -427,6 +430,10 @@ class TimelineViewModel: TimelineViewModelType, TimelineViewModelProtocol {
|
||||
switch callback {
|
||||
case .updatedTimelineItems(let updatedItems, let isSwitchingTimelines):
|
||||
buildTimelineViews(timelineItems: updatedItems, isSwitchingTimelines: isSwitchingTimelines)
|
||||
|
||||
if !updatedItems.isEmpty {
|
||||
analyticsService.signpost.finishTransaction(.openRoom)
|
||||
}
|
||||
case .paginationState(let paginationState):
|
||||
if state.timelineState.paginationState != paginationState {
|
||||
state.timelineState.paginationState = paginationState
|
||||
|
||||
Reference in New Issue
Block a user