handle drives with async or sync slice fns
This commit is contained in:
parent
7b1f230ded
commit
24e99495e9
1 changed files with 2 additions and 2 deletions
|
|
@ -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);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue