Skip to content

Commit

Permalink
fixup! Show LO confirmation alert based on toggle in Call Visualizer
Browse files Browse the repository at this point in the history
This PR displays Live Observation confirmation alert based on site settings

MOB-2811
  • Loading branch information
rasmustautsglia committed Nov 2, 2023
1 parent df1264e commit c252827
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions GliaWidgets/Sources/ViewModel/EngagementViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -164,15 +164,16 @@ class EngagementViewModel: CommonEngagementModel {
})
case let .enqueueing(mediaType):
environment.fetchSiteConfigurations { [weak self] result in
guard let self else { return }
switch result {
case let .success(site):
if site.mobileConfirmDialog == false {
self?.enqueue(mediaType: mediaType)
self.enqueue(mediaType: mediaType)
} else {
self?.showLiveObservationConfirmation(in: mediaType)
self.showLiveObservationConfirmation(in: mediaType)
}
case .failure:
self?.showAlert(with: self?.alertConfiguration.unexpectedError, dismissed: nil)
self.showAlert(with: self.alertConfiguration.unexpectedError, dismissed: nil)
}
}
default:
Expand Down
2 changes: 1 addition & 1 deletion GliaWidgetsTests/Sources/Glia/GliaTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ final class GliaTests: XCTestCase {
}
gliaEnv.callVisualizerPresenter = .init(presenter: { nil })
gliaEnv.coreSDKConfigurator.configureWithInteractor = { _ in }

gliaEnv.coreSdk.fetchSiteConfigurations = { _ in }
let sdk = Glia(environment: gliaEnv)
sdk.onEvent = {
calls.append(.onEvent($0))
Expand Down

0 comments on commit c252827

Please sign in to comment.