actionType fix
This commit is contained in:
parent
77af932f5d
commit
9c0bea033c
@ -36,8 +36,8 @@ public class ButtonModel: MoleculeProtocol {
|
||||
let typeContainer = try decoder.container(keyedBy: CodingKeys.self)
|
||||
backgroundColor = try typeContainer.decodeIfPresent(Color.self, forKey: .backgroundColor)
|
||||
title = try typeContainer.decode(String.self, forKey: .title)
|
||||
action = try typeContainer.decodeModel(codingKey: .action, typeCodingKey: ActionCodingKey.type)
|
||||
style = try typeContainer.decode(ButtonStyle.self, forKey: .style)
|
||||
action = try typeContainer.decodeModel(codingKey: .action, typeCodingKey: ActionCodingKey.actionType)
|
||||
style = try typeContainer.decodeIfPresent(ButtonStyle.self, forKey: .style)
|
||||
}
|
||||
|
||||
public func encode(to encoder: Encoder) throws {
|
||||
|
||||
@ -45,7 +45,7 @@ public class CaretLinkModel: MoleculeProtocol {
|
||||
if let enabled = try typeContainer.decodeIfPresent(Bool.self, forKey: .enabled) {
|
||||
self.enabled = enabled
|
||||
}
|
||||
action = try typeContainer.decodeModel(codingKey: .action, typeCodingKey: ActionCodingKey.type)
|
||||
action = try typeContainer.decodeModel(codingKey: .action, typeCodingKey: ActionCodingKey.actionType)
|
||||
}
|
||||
|
||||
public func encode(to encoder: Encoder) throws {
|
||||
|
||||
@ -33,7 +33,7 @@ public class LinkModel: MoleculeProtocol {
|
||||
let typeContainer = try decoder.container(keyedBy: CodingKeys.self)
|
||||
backgroundColor = try typeContainer.decodeIfPresent(Color.self, forKey: .backgroundColor)
|
||||
title = try typeContainer.decode(String.self, forKey: .title)
|
||||
action = try typeContainer.decodeModel(codingKey: .action, typeCodingKey: ActionCodingKey.type)
|
||||
action = try typeContainer.decodeModel(codingKey: .action, typeCodingKey: ActionCodingKey.actionType)
|
||||
if let enabled = try typeContainer.decodeIfPresent(Bool.self, forKey: .enabled) {
|
||||
self.enabled = enabled
|
||||
}
|
||||
|
||||
@ -28,7 +28,7 @@ import MVMCore
|
||||
required public init(from decoder: Decoder) throws {
|
||||
let typeContainer = try decoder.container(keyedBy: ListItemCodingKeys.self)
|
||||
backgroundColor = try typeContainer.decodeIfPresent(Color.self, forKey: .backgroundColor)
|
||||
action = try typeContainer.decodeModelIfPresent(codingKey: .action, typeCodingKey: ActionCodingKey.type)
|
||||
action = try typeContainer.decodeModelIfPresent(codingKey: .action, typeCodingKey: ActionCodingKey.actionType)
|
||||
hideArrow = try typeContainer.decodeIfPresent(Bool.self, forKey: .hideArrow)
|
||||
line = try typeContainer.decodeIfPresent(LineModel.self, forKey: .line)
|
||||
style = try typeContainer.decodeIfPresent(String.self, forKey: .style)
|
||||
|
||||
@ -24,10 +24,11 @@ import Foundation
|
||||
ModelRegistry.register(TabsModel.self)
|
||||
ModelRegistry.register(ScrollerModel.self)
|
||||
ModelRegistry.register(CornerLabelsModel.self)
|
||||
// buttons
|
||||
ModelRegistry.register(LineModel.self)
|
||||
// buttons
|
||||
ModelRegistry.register(ButtonModel.self)
|
||||
ModelRegistry.register(TwoButtonViewModel.self)
|
||||
ModelRegistry.register(LinkModel.self)
|
||||
// list items
|
||||
ModelRegistry.register(ListItemModel.self)
|
||||
ModelRegistry.register(DropDownListItemModel.self)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user