mirror of
https://github.com/nasa/openmct.git
synced 2024-12-19 05:07:52 +00:00
[Persistence] Reliably return promises
This commit is contained in:
parent
b60eff2f5e
commit
771542ee5f
@ -89,7 +89,7 @@ define(
|
|||||||
TransactionService.prototype.commit = function () {
|
TransactionService.prototype.commit = function () {
|
||||||
var transaction = this.transaction;
|
var transaction = this.transaction;
|
||||||
this.transaction = this.transactionStack.pop();
|
this.transaction = this.transactionStack.pop();
|
||||||
return transaction && transaction.commit();
|
return transaction ? transaction.commit() : Promise.reject();
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -103,7 +103,7 @@ define(
|
|||||||
TransactionService.prototype.cancel = function () {
|
TransactionService.prototype.cancel = function () {
|
||||||
var transaction = this.transaction;
|
var transaction = this.transaction;
|
||||||
this.transaction = this.transactionStack.pop();
|
this.transaction = this.transactionStack.pop();
|
||||||
return transaction && transaction.cancel();
|
return transaction ? transaction.cancel() : Promise.reject();
|
||||||
};
|
};
|
||||||
|
|
||||||
TransactionService.prototype.size = function () {
|
TransactionService.prototype.size = function () {
|
||||||
|
Loading…
Reference in New Issue
Block a user