bug fixes

This commit is contained in:
Scott Pfeil 2022-08-11 22:34:37 -04:00
parent 1f75221915
commit 31169e318e
5 changed files with 11 additions and 3 deletions

View File

@ -210,7 +210,7 @@ open class ButtonModel: ButtonModelProtocol, MoleculeModelProtocol, FormGroupWat
if let style = try typeContainer.decodeIfPresent(Styler.Button.Style.self, forKey: .style){
self.style = style
setFacade(by: style)
} else if let style = decoder.context?.value(forKey: CodingKeys.style.stringValue) as? Styler.Button.Style { ///Reading the style param from context which is set is molecules, ex: TwoButtonView
} else if let style = decoder.context?.value(forKey: CodingKeys.style.stringValue) as? Styler.Button.Style { ///Reading the style param from context which is set is molecules, ex: TwoButtonView
self.style = style
setFacade(by: style)
} else { ///Default style

View File

@ -460,7 +460,7 @@ import MVMCore
do {
if let behavior = behaviors?.compactMap({ $0 as? PageCustomActionHandlerBehavior }).first(where: { $0.canHandleAction(with: model, additionalData: additionalData) }) {
delegateObject?.actionDelegate?.logAction?(withActionInformation: model.toJSON(), additionalData: additionalData)
logAction(withActionInformation: model.toJSON(), additionalData: additionalData)
try await behavior.handleAction(with: model, additionalData: additionalData)
} else {
try await MVMCoreUIActionHandler.shared()?.handleAction(with: model, additionalData: additionalData, delegateObject: delegateObject)

View File

@ -155,7 +155,7 @@ open class SubNavManagerController: ViewController, MVMCoreViewManagerProtocol,
/// Logs the action for the selected tab.
open func trackSelectTab() {
guard let action = tabs.tabsModel?.tabs[tabs.selectedIndex].action else { return }
MVMCoreUIActionHandler.shared()?.logAction(with: action, additionalData: getAdditionalDataForNewTabLoad(indexPath: IndexPath(row: tabs.selectedIndex, section: 0)), delegateObject: delegateObjectIVar)
MVMCoreUIActionHandler.shared()?.logAction(with: action.toJSON(), additionalData: getAdditionalDataForNewTabLoad(indexPath: IndexPath(row: tabs.selectedIndex, section: 0)), delegateObject: delegateObjectIVar)
}
/// Allow override of additioonal data for tab press action

View File

@ -25,6 +25,11 @@ import SafariServices
}
}
open override func logAction(with JSON: [AnyHashable: Any]?, additionalData: [AnyHashable: Any]?, delegateObject: DelegateObject?) {
// Legacy logging.
delegateObject?.actionDelegate?.logAction?(withActionInformation: JSON, additionalData: additionalData) ?? MVMCoreUILoggingHandler.shared()?.defaultLogAction(forController: nil, actionInformation: JSON, additionalData: additionalData)
}
@objc(openURLInSafariWebView:)
@MainActor
open func openURL(inSafariWebView url: URL) {

View File

@ -7,6 +7,7 @@
//
import Foundation
import MVMCore
/// Allows top alerts to determine the status bar color and style.
protocol StatusBarUI {
@ -138,3 +139,5 @@ public extension MVMCoreUITopAlertView {
}
}
}
extension MVMCoreUITopAlertView: ActionDelegateProtocol {}