mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 21:06:00 +00:00
Posthog: report SessionSecurityState (#2795)
* Posthog: report SessionSecurityState * Review quick change --------- Co-authored-by: Mauro <34335419+Velin92@users.noreply.github.com>
This commit is contained in:
@@ -14,6 +14,7 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
import AnalyticsEvents
|
||||
import Combine
|
||||
import SwiftUI
|
||||
|
||||
@@ -86,6 +87,21 @@ class HomeScreenViewModel: HomeScreenViewModelType, HomeScreenViewModelProtocol
|
||||
}
|
||||
.store(in: &cancellables)
|
||||
|
||||
userSession.sessionSecurityStatePublisher
|
||||
.receive(on: DispatchQueue.main)
|
||||
.filter { state in
|
||||
state.verificationState != .unknown
|
||||
&& state.recoveryState != .settingUp
|
||||
&& state.recoveryState != .unknown
|
||||
}
|
||||
.sink { [weak self] state in
|
||||
guard let self else { return }
|
||||
|
||||
self.analyticsService.updateUserProperties(AnalyticsEvent.newVerificationStateUserProperty(verificationState: state.verificationState, recoveryState: state.recoveryState))
|
||||
self.analyticsService.trackSessionSecurityState(state)
|
||||
}
|
||||
.store(in: &cancellables)
|
||||
|
||||
selectedRoomPublisher
|
||||
.weakAssign(to: \.state.selectedRoomID, on: self)
|
||||
.store(in: &cancellables)
|
||||
|
||||
Reference in New Issue
Block a user