Merge branch 'develop' into feature/heart

This commit is contained in:
Lekshmi S 2020-09-18 08:42:56 +05:30
commit 56b1ab2be7
2 changed files with 6 additions and 6 deletions

View File

@ -18,7 +18,7 @@ public class CollapsableNotificationModel: MoleculeModelProtocol {
public var body: LabelModel?
public var button: ButtonModel?
public var closeButton: NotificationXButtonModel?
public var alwaysShowCollapsedLabel = false
public var alwaysShowTopLabel = false
public var collapseTime: Int = 5
public var initiallyCollapsed = false
public var pages: [String]?
@ -37,7 +37,7 @@ public class CollapsableNotificationModel: MoleculeModelProtocol {
case body
case button
case closeButton
case alwaysShowCollapsedLabel
case alwaysShowTopLabel
case collapseTime
case initiallyCollapsed
case pages
@ -52,8 +52,8 @@ public class CollapsableNotificationModel: MoleculeModelProtocol {
body = try typeContainer.decodeIfPresent(LabelModel.self, forKey: .body)
button = try typeContainer.decodeIfPresent(ButtonModel.self, forKey: .button)
closeButton = try typeContainer.decodeIfPresent(NotificationXButtonModel.self, forKey: .closeButton)
if let alwaysShowCollapsedLabel = try typeContainer.decodeIfPresent(Bool.self, forKey: .alwaysShowCollapsedLabel) {
self.alwaysShowCollapsedLabel = alwaysShowCollapsedLabel
if let alwaysShowTopLabel = try typeContainer.decodeIfPresent(Bool.self, forKey: .alwaysShowTopLabel) {
self.alwaysShowTopLabel = alwaysShowTopLabel
}
if let collapseTime = try typeContainer.decodeIfPresent(Int.self, forKey: .collapseTime) {
self.collapseTime = collapseTime
@ -74,7 +74,7 @@ public class CollapsableNotificationModel: MoleculeModelProtocol {
try container.encodeIfPresent(body, forKey: .body)
try container.encodeIfPresent(button, forKey: .button)
try container.encodeIfPresent(closeButton, forKey: .closeButton)
try container.encode(alwaysShowCollapsedLabel, forKey: .alwaysShowCollapsedLabel)
try container.encode(alwaysShowTopLabel, forKey: .alwaysShowTopLabel)
try container.encode(collapseTime, forKey: .collapseTime)
try container.encode(initiallyCollapsed, forKey: .initiallyCollapsed)
try container.encodeIfPresent(pages, forKey: .pages)

View File

@ -15,7 +15,7 @@ extension MVMCoreUITopAlertExpandableView: MoleculeViewProtocol {
guard let model = model as? CollapsableNotificationModel else { return }
backgroundColor = model.backgroundColor?.uiColor ?? .mvmGreen
collapseTime = model.collapseTime
onlyShowTopMessageWhenCollapsed = !model.alwaysShowCollapsedLabel
onlyShowTopMessageWhenCollapsed = !model.alwaysShowTopLabel
var actionMap = model.button?.action.toJSON()
if let title = model.button?.title {