@wandelbots/wandelbots-js-react-components 1.44.3 → 1.44.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wandelbots/wandelbots-js-react-components",
3
- "version": "1.44.3",
3
+ "version": "1.44.4",
4
4
  "description": "React UI toolkit for building applications on top of the Wandelbots platform",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -84,11 +84,11 @@ export const JoggingPanel = externalizeComponent(
84
84
  if (!store) return
85
85
 
86
86
  if (props.locked) {
87
- store.locks.add("external")
87
+ store.lock("external")
88
88
  } else {
89
- store.locks.delete("external")
89
+ store.unlock("external")
90
90
  }
91
- }, [props.locked])
91
+ }, [state.joggingStore, props.locked])
92
92
 
93
93
  return (
94
94
  <Stack
@@ -463,15 +463,23 @@ export class JoggingStore {
463
463
  this.selectedCartesianMotionType = type
464
464
  }
465
465
 
466
+ lock(id: string) {
467
+ this.locks.add(id)
468
+ }
469
+
470
+ unlock(id: string) {
471
+ this.locks.delete(id)
472
+ }
473
+
466
474
  /** Lock the UI until the given async callback resolves */
467
475
  async withMotionLock(fn: () => Promise<void>) {
468
476
  const lockId = uniqueId()
469
- this.locks.add(lockId)
477
+ this.lock(lockId)
470
478
 
471
479
  try {
472
480
  return await fn()
473
481
  } finally {
474
- this.locks.delete(lockId)
482
+ this.unlock(lockId)
475
483
  }
476
484
  }
477
485
  }