Skip to content
This repository has been archived by the owner on Mar 4, 2024. It is now read-only.

Commit

Permalink
fix: only autosave when necessary
Browse files Browse the repository at this point in the history
  • Loading branch information
prescientmoon committed Jul 26, 2020
1 parent 68e98ec commit d3f440d
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/Component/Editor.purs
Original file line number Diff line number Diff line change
Expand Up @@ -645,7 +645,7 @@ component =
]
]
, whenElem isAdmin \_ ->
HH.div [ className "project-setting" ]
HH.div [ className "setting" ]
[ HH.div [ className "setting__label" ] [ HH.text "Example:" ]
, HH.div [ className "setting__switch-input" ]
[ switch { checked: isExample, round: true } (Just <<< SetExample)
Expand Down
4 changes: 2 additions & 2 deletions src/typescript/render.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ export const createNodeGeometry = (
position: Vec2Like,
numberOfInputs: number,
hasOutput: boolean,
name?: string
name: string | null
): NodeGeometry => {
const inputGeom =
numberOfInputs === 0
Expand Down Expand Up @@ -186,7 +186,7 @@ export const createNodeGeometry = (
fill: "#262335",
padding: textPadding
},
name,
name ?? undefined,
font
)

Expand Down
4 changes: 2 additions & 2 deletions src/typescript/save.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ interface SavedData {
position: Vec2Like
hasOutput: boolean
inputCount: number
name?: string
name: string | null
}>
}

Expand Down Expand Up @@ -74,7 +74,7 @@ export const geometryCacheToJson = (cache: GeometryCache): SavedData => {
position: node.position as Vec2Like,
inputCount: node.inputs[0].attribs!.selectable ? node.inputs.length : 0,
hasOutput: node.output !== null,
name: node.name === null ? undefined : node.name.value
name: node.name === null ? null : node.name.value
}
})
}
Expand Down
2 changes: 1 addition & 1 deletion src/typescript/sync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export const createNode = (cache: GeometryCache) => (id: NodeId) => (
[0, 0], // TODO: find a better way to place nodes
inputCount,
hasOutput,
name ?? undefined
name
)

cache.zOrder.push(id)
Expand Down

0 comments on commit d3f440d

Please sign in to comment.