Skip to content

Commit

Permalink
fix: args should be empty when args was falsy (#369)
Browse files Browse the repository at this point in the history
  • Loading branch information
enpitsuLin authored Aug 18, 2023
1 parent 453b031 commit 81b7914
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/core/nodeOps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,10 +184,12 @@ export const nodeOps: RendererOptions<TresObject, TresObject> = {
let finalKey = kebabToCamel(key)
let target = root?.[finalKey]

if (key === 'args' && !deepArrayEqual(_prevValue, nextValue)) {
if (key === 'args') {
const prevNode = node as TresObject3D
const prevArgs = _prevValue ?? []
const args = nextValue ?? []

if (node.type && nextValue.length > 0) {
if (node.type && !deepArrayEqual(prevArgs, args)) {
root = Object.assign(prevNode, new catalogue.value[node.type](...nextValue))
}
return
Expand Down

0 comments on commit 81b7914

Please sign in to comment.