Merge branch 'bugfix/CXTDT-431466' into 'develop'

CXTDT-431466: Fix for notification handler update.

### Summary
Bugfix for missing update notification logic.

### JIRA Ticket
https://onejira.verizon.com/browse/CXTDT-431466

Co-authored-by: Scott Pfeil <Scott.Pfeil3@verizonwireless.com>

See merge request https://gitlab.verizon.com/BPHV_MIPS/mvm_core_ui/-/merge_requests/975
This commit is contained in:
Pfeil, Scott Robert 2023-06-30 17:51:00 +00:00
commit 82126f630d
2 changed files with 4 additions and 14 deletions

View File

@ -12,7 +12,6 @@ import MVMCore
/// A simple container view that shows and hides a notification.
public class NotificationContainerView: UIView {
public var currentModel: NotificationModel?
public var currentNotificationView: UIView?
lazy private var height = heightAnchor.constraint(equalToConstant: 0)
@ -82,17 +81,7 @@ extension NotificationContainerView: NotificationTransitionDelegateProtocol {
@MainActor
public func update(with model: NotificationModel, delegateObject: MVMCoreUIDelegateObject?) {
guard let currentModel = currentModel,
currentModel.type == model.type else { return }
guard let molecule = currentNotificationView as? MoleculeViewProtocol,
currentModel.molecule.moleculeName == model.molecule.moleculeName else {
// Log that we couldn't update.
if let errorObject = MVMCoreErrorObject(title: nil, message: nil, messageToLog: nil, code: ErrorCode.parsingJSON.rawValue, domain: ErrorDomainNative, location: "TopNotification update \(String(describing: model.type))") {
MVMCoreUILoggingHandler.addError(toLog: errorObject)
}
return
}
guard let molecule = currentNotificationView as? MoleculeViewProtocol else { return }
// Update molecule
molecule.reset()
molecule.set(with: model.molecule, delegateObject, nil)

View File

@ -563,8 +563,9 @@ extension NotificationOperation {
!isCancelled else { return }
self.log(message: "Operation Updated")
updateStopTimer()
Task { @MainActor in
transitionDelegate.update(with: notificationModel, delegateObject: delegateObject)
Task {
await transitionDelegate.update(with: notificationModel, delegateObject: delegateObject)
NotificationHandler.shared()?.onNotificationUpdated.send((notification, notificationModel))
}
}