From da41081289b2ffe7439fa74c8e670acabce8095a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Csubrra7=E2=80=9D?= <“ramya.subramaniam@verizon.com”> Date: Wed, 15 Jul 2020 17:11:45 +0530 Subject: [PATCH] updating review comments --- .../Templates/ModalMoleculeListTemplate.swift | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/MVMCoreUI/Atomic/Templates/ModalMoleculeListTemplate.swift b/MVMCoreUI/Atomic/Templates/ModalMoleculeListTemplate.swift index 47655762..2dffb26f 100644 --- a/MVMCoreUI/Atomic/Templates/ModalMoleculeListTemplate.swift +++ b/MVMCoreUI/Atomic/Templates/ModalMoleculeListTemplate.swift @@ -15,7 +15,7 @@ open class ModalMoleculeListTemplate: MoleculeListTemplate { //-------------------------------------------------- public var closeButton: Button? - + //-------------------------------------------------- // MARK: - Lifecycle //-------------------------------------------------- @@ -24,13 +24,14 @@ open class ModalMoleculeListTemplate: MoleculeListTemplate { super.handleNewData() closeButton = MVMCoreUICommonViewsUtility.addCloseButton(to: view, action: { [weak self] _ in - if let self = self { - guard let actionMap = self.loadObject?.pageJSON?.optionalDictionaryWithChainOfKeysOrIndexes([KeyButtonMap,"CloseButton"]) else { - MVMCoreNavigationHandler.shared()?.removeCurrentViewController() - return - } - MVMCoreActionHandler.shared()?.handleAction(with: actionMap, additionalData: nil, delegateObject: self.delegateObjectIVar) + guard let self = self else { + return } + guard let actionMap = self.loadObject?.pageJSON?.optionalDictionaryWithChainOfKeysOrIndexes([KeyButtonMap,"CloseButton"]) else { + MVMCoreActionHandler.shared()?.handleAction(with: ActionBackModel().toJSON(), additionalData: nil, delegateObject: self.delegateObjectIVar) + return + } + MVMCoreActionHandler.shared()?.handleAction(with: actionMap, additionalData: nil, delegateObject: self.delegateObjectIVar) }) }