handle drives with async or sync slice fns

This commit is contained in:
Stewart Allen 2025-06-23 09:22:04 -04:00
commit 24e99495e9

View file

@ -837,8 +837,8 @@ class Widget {
let drv = driver[settings.mode.toUpperCase()]; let drv = driver[settings.mode.toUpperCase()];
if (drv) { if (drv) {
drv.slice(settings, widget, catchupdate, catchdone) let promise = drv.slice(settings, widget, catchupdate, catchdone);
.catch(error => ondone(error)); if (promise) promise.catch(error => ondone(error));
} else { } else {
console.log('invalid mode: '+settings.mode); console.log('invalid mode: '+settings.mode);
ondone('invalid mode: '+settings.mode); ondone('invalid mode: '+settings.mode);