Reordering the conditions for button style update.
This commit is contained in:
parent
d1b1db1967
commit
4f4d9a126e
@ -206,11 +206,11 @@ open class ButtonModel: ButtonModelProtocol, MoleculeModelProtocol, FormGroupWat
|
|||||||
title = try typeContainer.decode(String.self, forKey: .title)
|
title = try typeContainer.decode(String.self, forKey: .title)
|
||||||
action = try typeContainer.decodeModel(codingKey: .action)
|
action = try typeContainer.decodeModel(codingKey: .action)
|
||||||
|
|
||||||
///Reading the style param from context which is set is molecules, ex: TwoButtonView
|
///Style captured from the JSON
|
||||||
if let style = decoder.context?.value(forKey: CodingKeys.style.stringValue) as? Styler.Button.Style{
|
if let style = try typeContainer.decodeIfPresent(Styler.Button.Style.self, forKey: .style){
|
||||||
self.style = style
|
self.style = style
|
||||||
setFacade(by: style)
|
setFacade(by: style)
|
||||||
} else if let style = try typeContainer.decodeIfPresent(Styler.Button.Style.self, forKey: .style) { ///Style captured from the JSON
|
} 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
|
self.style = style
|
||||||
setFacade(by: style)
|
setFacade(by: style)
|
||||||
} else { ///Default style
|
} else { ///Default style
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user