Merge pull request #603 from gyfelton/transaction-promise-resolve
Make sure the promise is resolved/rejected for transaction
This commit is contained in:
commit
78a2b0a81a
|
@ -195,8 +195,11 @@ export default class Reference extends ReferenceBase {
|
|||
return new Promise((resolve, reject) => {
|
||||
const onCompleteWrapper = (error, committed, snapshotData) => {
|
||||
if (isFunction(onComplete)) {
|
||||
if (error) return onComplete(error, committed, null);
|
||||
return onComplete(null, committed, new Snapshot(this, snapshotData));
|
||||
if (error) {
|
||||
onComplete(error, committed, null);
|
||||
} else {
|
||||
onComplete(null, committed, new Snapshot(this, snapshotData));
|
||||
}
|
||||
}
|
||||
|
||||
if (error) return reject(error);
|
||||
|
|
Loading…
Reference in New Issue