ecoding & decoding fillContainer param in TwoButtonView molecule
This commit is contained in:
parent
aa6e55e55d
commit
deac7b37f0
@ -38,6 +38,7 @@ public class TwoButtonViewModel: ParentMoleculeModelProtocol {
|
||||
case backgroundColor
|
||||
case primaryButton
|
||||
case secondaryButton
|
||||
case fillContainer
|
||||
}
|
||||
|
||||
//--------------------------------------------------
|
||||
@ -69,6 +70,7 @@ public class TwoButtonViewModel: ParentMoleculeModelProtocol {
|
||||
try decoder.setContext(value: Use.secondary, for: "style") {
|
||||
self.secondaryButton = try typeContainer.decodeMoleculeIfPresent(codingKey: .secondaryButton)
|
||||
}
|
||||
fillContainer = try typeContainer.decodeIfPresent(Bool.self, forKey: .fillContainer) ?? false
|
||||
}
|
||||
|
||||
public func encode(to encoder: Encoder) throws {
|
||||
@ -78,5 +80,6 @@ public class TwoButtonViewModel: ParentMoleculeModelProtocol {
|
||||
try container.encodeIfPresent(backgroundColor, forKey: .backgroundColor)
|
||||
try container.encodeIfPresent(primaryButton, forKey: .primaryButton)
|
||||
try container.encodeIfPresent(secondaryButton, forKey: .secondaryButton)
|
||||
try container.encodeIfPresent(fillContainer, forKey: .fillContainer)
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user