Digital PCT265 defect DE307-687: Slightly better logging clarity, making sure the base page is logged before the module counterparts.
This commit is contained in:
parent
be797aaee2
commit
10c63a52b9
@ -30,7 +30,7 @@ public class ReplaceableMoleculeBehavior: PageMoleculeTransformationBehavior, Pa
|
|||||||
String(describing: Self.self)
|
String(describing: Self.self)
|
||||||
}
|
}
|
||||||
|
|
||||||
var hasPreviouslyBeenShown = false
|
var isPageShowing = false
|
||||||
var previouslyReplacedIds = Set<String>()
|
var previouslyReplacedIds = Set<String>()
|
||||||
var moleculeIds: [String]
|
var moleculeIds: [String]
|
||||||
public var modulesToListenFor: [String]
|
public var modulesToListenFor: [String]
|
||||||
@ -120,21 +120,22 @@ public class ReplaceableMoleculeBehavior: PageMoleculeTransformationBehavior, Pa
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
previouslyReplacedIds.insert(moleculeId)
|
previouslyReplacedIds.insert(moleculeId)
|
||||||
|
guard isPageShowing else { return } // Page has not been made visible yet. (Pulled and replaced from cache on load or background update.) Hold reporting until onPageShown.
|
||||||
MVMCoreUILoggingHandler.shared()?.defaultLogPageUpdate(forController: viewController, from: module)
|
MVMCoreUILoggingHandler.shared()?.defaultLogPageUpdate(forController: viewController, from: module)
|
||||||
}
|
}
|
||||||
|
|
||||||
public func onPageShown(_ delegateObject: MVMCoreUIDelegateObject?) {
|
public func onPageShown(_ delegateObject: MVMCoreUIDelegateObject?) {
|
||||||
guard hasPreviouslyBeenShown else {
|
isPageShowing = true
|
||||||
// Skip first replacement build handled in onPageNew. (Pulled and reported from cache.)
|
debugLog("Page shown. Send molecule analytics for: \(previouslyReplacedIds)")
|
||||||
hasPreviouslyBeenShown = true
|
|
||||||
return
|
|
||||||
}
|
|
||||||
debugLog("Page reshown. Resend replaced molecule analytics for: \(previouslyReplacedIds)")
|
|
||||||
previouslyReplacedIds.forEach { id in
|
previouslyReplacedIds.forEach { id in
|
||||||
logUpdated(moleculeId: id)
|
logUpdated(moleculeId: id)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public func onPageHidden(_ delegateObject: MVMCoreUIDelegateObject?) {
|
||||||
|
isPageShowing = false
|
||||||
|
}
|
||||||
|
|
||||||
deinit {
|
deinit {
|
||||||
debugLog("deinit")
|
debugLog("deinit")
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user