From 3827edcf6ee64627dfa39e4937356bcf171bb202 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:13:16 +0530 Subject: [PATCH] updating review comments --- .../Atomic/Templates/ModalMoleculeStackTemplate.swift | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/MVMCoreUI/Atomic/Templates/ModalMoleculeStackTemplate.swift b/MVMCoreUI/Atomic/Templates/ModalMoleculeStackTemplate.swift index 937cc91d..57a58a3c 100644 --- a/MVMCoreUI/Atomic/Templates/ModalMoleculeStackTemplate.swift +++ b/MVMCoreUI/Atomic/Templates/ModalMoleculeStackTemplate.swift @@ -13,9 +13,14 @@ open class ModalMoleculeStackTemplate: MoleculeStackTemplate { override open func handleNewData() { super.handleNewData() _ = MVMCoreUICommonViewsUtility.addCloseButton(to: view, action: {[weak self] _ in - if let _ = self { - MVMCoreNavigationHandler.shared()?.removeCurrentViewController() - } + 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) }) }