Skip to content

Commit

Permalink
Merge pull request #169 from wearepal/fix-booltocat
Browse files Browse the repository at this point in the history
bugfix: caching issue on boolean to cat node
  • Loading branch information
paulthatjazz authored Oct 17, 2023
2 parents 0da756b + 067992c commit 70f6b1b
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { BaseComponent } from './base_component'
import { NodeData, WorkerInputs, WorkerOutputs } from 'rete/types/core/data'
import { booleanDataSocket, categoricalDataSocket } from '../socket_types'
import { BooleanTileGrid, CategoricalTileGrid } from '../tile_grid'
import { isEqual } from 'lodash'

export class CategoricalComponent extends BaseComponent {
cachedData: CategoricalTileGrid
Expand All @@ -28,8 +29,7 @@ export class CategoricalComponent extends BaseComponent {
const booleanData = inputs['in']
if (booleanData.length === 0) { return }


if (booleanData.toString() === this.previousInput.toString()) {
if (isEqual(booleanData, this.previousInput)) {
outputs['out'] = this.cachedData
} else {
this.previousInput = booleanData as BooleanTileGrid[]
Expand Down

0 comments on commit 70f6b1b

Please sign in to comment.