Skip to content

Commit

Permalink
♻️ Update debugger to ping healthcheck only once opened
Browse files Browse the repository at this point in the history
  • Loading branch information
mmaatttt committed Jun 6, 2022
1 parent f148d0d commit 0ce414d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,7 @@ internal class DebugViewModel: ObservableObject {
self.isAnonymous = isAnonymous
self.userIdentified = !currentUserID.isEmpty

// Initial connectivity check
ping()

connectedStatus.action = Action(symbolName: "arrow.triangle.2.circlepath") { self.ping() }
connectedStatus.action = Action(symbolName: "arrow.triangle.2.circlepath") { [weak self] in self?.ping() }
}

func reset() {
Expand Down
7 changes: 6 additions & 1 deletion Sources/AppcuesKit/Presentation/Debugger/UIDebugger.swift
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,13 @@ internal class UIDebugger: UIDebugging {
@available(iOS 13.0, *)
extension UIDebugger: DebugViewDelegate {
func debugView(did event: DebugView.Event) {
if case .hide = event {
switch event {
case .hide:
hide()
case .open:
viewModel.ping()
case .show, .close, .reposition:
break
}
}
}
Expand Down

0 comments on commit 0ce414d

Please sign in to comment.