Skip to content

Commit

Permalink
fixup! Connecting state issue fixes
Browse files Browse the repository at this point in the history
Revert strong engagement refs back

MOB-2730
  • Loading branch information
Egor Egorov committed Oct 12, 2023
1 parent 78755e5 commit 6425083
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion GliaWidgets/Sources/Interactor/Interactor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class Interactor {
}

let configuration: Configuration
weak var currentEngagement: CoreSdkClient.Engagement?
var currentEngagement: CoreSdkClient.Engagement?

/// Flag indicating if configuration was already performed.
var isConfigurationPerformed: Bool = false
Expand Down
5 changes: 4 additions & 1 deletion GliaWidgets/Sources/ViewModel/EngagementViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ class EngagementViewModel: CommonEngagementModel {
let alertConfiguration: AlertConfiguration
let environment: Environment
let screenShareHandler: ScreenShareHandler
weak var activeEngagement: CoreSdkClient.Engagement?
// Need to keep strong reference of `activeEngagement`,
// to be able to fetch survey after ending engagement
var activeEngagement: CoreSdkClient.Engagement?

private(set) var isViewActive = ObservableValue<Bool>(with: false)

Expand All @@ -34,6 +36,7 @@ class EngagementViewModel: CommonEngagementModel {
}

deinit {
print("☠️", Self.self, ObjectIdentifier(self))
interactor.removeObserver(self)
screenShareHandler.status().removeObserver(self)
screenShareHandler.cleanUp()
Expand Down

0 comments on commit 6425083

Please sign in to comment.