Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,9 @@ final class InAppConfigutationMapper: InAppConfigurationMapperProtocol {
}

func filterByInappsEvents(inapps: [InApp], filteredInAppsByEvent: inout [InAppMessageTriggerEvent: [InAppTransitionData]]) {
for inapp in inapps {
var triggerEvent: InAppMessageTriggerEvent = .start
var triggerEvent: InAppMessageTriggerEvent = savedEventForTargeting.map { .applicationEvent($0) } ?? .start

for inapp in inapps {
let inAppAlreadyAddedForEvent = filteredInAppsByEvent[triggerEvent]?.contains(where: { $0.inAppId == inapp.id }) ?? false

// If the in-app message has already been added, continue to the next message
Expand All @@ -149,10 +149,6 @@ final class InAppConfigutationMapper: InAppConfigurationMapperProtocol {
continue
}

if let event = targetingChecker.event {
triggerEvent = .applicationEvent(event)
}

var inAppsForEvent = filteredInAppsByEvent[triggerEvent] ?? [InAppTransitionData]()
if let inAppFormVariants = inapp.form.variants.first {
let formData = InAppTransitionData(inAppId: inapp.id,
Expand Down
Loading