Skip to content

Commit

Permalink
fixup! Handle ongoing engagement in EntryWidget
Browse files Browse the repository at this point in the history
Remove logic for changing active engagement outside interactor and add onEngagementChanged interface to interactor that updates active engagement

MOB-3806
  • Loading branch information
rasmustautsglia committed Dec 11, 2024
1 parent 876c0e9 commit 88ccb46
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion GliaWidgets/Public/Glia/Glia+EntryWidget.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@ extension Glia {
guard let self else { return false }
return pendingInteraction.hasPendingInteraction
},
currentInteractor: { self.interactor }
currentInteractor: { [weak self] in
guard let self else { return nil }
return interactor
}
)
)
}
Expand Down
4 changes: 2 additions & 2 deletions GliaWidgets/Sources/EntryWidget/EntryWidget.swift
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ public final class EntryWidget: NSObject {

engagementCancellable = environment.currentInteractor()?.$currentEngagement
.sink { [weak self] engagement in
guard let self = self else { return }
self.ongoingEngagement = engagement
guard let self else { return }
ongoingEngagement = engagement
handleQueuesMonitorUpdates(state: environment.queuesMonitor.state, unreadSecureMessagesCount: unreadSecureMessageCount)
}
}
Expand Down

0 comments on commit 88ccb46

Please sign in to comment.