1
0
Fork 0

lint fixes

This commit is contained in:
Enoch Riese 2022-11-14 16:53:31 -06:00
parent 18f588dc99
commit 3676c7af07
6 changed files with 13 additions and 12 deletions

View file

@ -56,9 +56,6 @@ const Stack = (props) => {
const stackLayout = layout.stacks?.[stackName]
// // Don't just assume this makes sense
if (typeof stackLayout?.move?.x === 'undefined') return null
// Use a ref for direct DOM manipulation
const stackRef = useRef(null)
const centerRef = useRef(null)
@ -82,6 +79,9 @@ const Stack = (props) => {
handleDrag(select(stackRef.current))
}, [rotate, stackRef, stackLayout])
// // Don't just assume this makes sense
if (typeof stackLayout?.move?.x === 'undefined') return null
// These are kept as vars because re-rendering on drag would kill performance
// Managing the difference between re-render and direct DOM updates makes this
// whole thing a bit tricky to wrap your head around
@ -144,7 +144,7 @@ const Stack = (props) => {
didDrag = true
setTransforms()
})
.on('end', function (event) {
.on('end', function () {
// save to gist if anything actually changed
if (didDrag) updateLayout()
@ -152,7 +152,7 @@ const Stack = (props) => {
})
/** reset the part's transforms */
const resetPart = (event) => {
const resetPart = () => {
rotation = 0
flipX = 0
flipY = 0