Skip to content

Commit

Permalink
fix(core): compatile with single callback in native2js
Browse files Browse the repository at this point in the history
  • Loading branch information
zoomchan-cxj committed Feb 24, 2023
1 parent 48e38c8 commit 3e0e914
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions core/js/bridge/android/native2js.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ global.hippyBridge = (_action, _callObj) => {
}
} else if (__GLOBAL__.moduleCallList[callObj.callId]) {
const callbackObj = __GLOBAL__.moduleCallList[callObj.callId];
if (callObj.result !== 0) {
typeof callbackObj.reject === 'function' && callbackObj.reject(callObj.params);
if (callObj.result !== 0 && typeof callbackObj.reject === 'function') {
callbackObj.reject(callObj.params);
} else {
typeof callbackObj.cb === 'function' && callbackObj.cb(callObj.params);
}
Expand Down
Loading

0 comments on commit 3e0e914

Please sign in to comment.