mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-04-21 09:16:26 +08:00
refactor(core): otherPromise in wrapInstance shouldn't check for error
This commit is contained in:
parent
8aca6718e1
commit
a7c62de389
@ -290,8 +290,10 @@ export function wrapInstance(pluginObj: any, methodName: string, opts: any = {})
|
|||||||
|
|
||||||
return getPromise((resolve: Function, reject: Function) => {
|
return getPromise((resolve: Function, reject: Function) => {
|
||||||
let result = callInstance(pluginObj, methodName, args, opts, resolve, reject);
|
let result = callInstance(pluginObj, methodName, args, opts, resolve, reject);
|
||||||
if (result && !result.error) {
|
if (result && !!result.then) {
|
||||||
result.then(resolve, reject);
|
result.then(resolve, reject);
|
||||||
|
} else {
|
||||||
|
reject();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user