Skip to content

Commit

Permalink
chore: synchronize workspaces
Browse files Browse the repository at this point in the history
  • Loading branch information
aeneasr committed Mar 14, 2024
1 parent 99e1bd4 commit 2391e9c
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions ui/node/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -358,23 +358,23 @@ func (n *Node) UnmarshalJSON(data []byte) error {
switch t := gjson.GetBytes(data, "type").String(); UiNodeType(t) {
case Text:
attr = &TextAttributes{
NodeType: string(Text),
NodeType: Text,
}
case Input:
attr = &InputAttributes{
NodeType: string(Input),
NodeType: Input,
}
case Anchor:
attr = &AnchorAttributes{
NodeType: string(Anchor),
NodeType: Anchor,
}
case Image:
attr = &ImageAttributes{
NodeType: string(Image),
NodeType: Image,
}
case Script:
attr = &ScriptAttributes{
NodeType: string(Script),
NodeType: Script,
}
default:
return fmt.Errorf("unexpected node type: %s", t)
Expand All @@ -401,19 +401,19 @@ func (n *Node) MarshalJSON() ([]byte, error) {
switch attr := n.Attributes.(type) {
case *TextAttributes:
t = Text
attr.NodeType = string(Text)
attr.NodeType = Text
case *InputAttributes:
t = Input
attr.NodeType = string(Input)
attr.NodeType = Input
case *AnchorAttributes:
t = Anchor
attr.NodeType = string(Anchor)
attr.NodeType = Anchor
case *ImageAttributes:
t = Image
attr.NodeType = string(Image)
attr.NodeType = Image
case *ScriptAttributes:
t = Script
attr.NodeType = string(Script)
attr.NodeType = Script
default:
return nil, errors.WithStack(fmt.Errorf("unknown node type: %T", n.Attributes))
}
Expand Down

0 comments on commit 2391e9c

Please sign in to comment.