@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/dist/components/jogging/JoggingStore.d.ts +2 -0
- package/dist/components/jogging/JoggingStore.d.ts.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +10 -4
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/jogging/JoggingPanel.tsx +3 -3
- package/src/components/jogging/JoggingStore.ts +10 -2
package/package.json
CHANGED
|
@@ -84,11 +84,11 @@ export const JoggingPanel = externalizeComponent(
|
|
|
84
84
|
if (!store) return
|
|
85
85
|
|
|
86
86
|
if (props.locked) {
|
|
87
|
-
store.
|
|
87
|
+
store.lock("external")
|
|
88
88
|
} else {
|
|
89
|
-
store.
|
|
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.
|
|
477
|
+
this.lock(lockId)
|
|
470
478
|
|
|
471
479
|
try {
|
|
472
480
|
return await fn()
|
|
473
481
|
} finally {
|
|
474
|
-
this.
|
|
482
|
+
this.unlock(lockId)
|
|
475
483
|
}
|
|
476
484
|
}
|
|
477
485
|
}
|