commitTransaction method

bool commitTransaction([
  1. String? tname
])

Commit the current transaction started by a call to #startTransaction.

For convenience, this method is called by Model#commitTransaction and Diagram#commitTransaction.

If this call stops a top-level transaction, we mark the #currentTransaction as complete (Transaction#isComplete), we add the Transaction to the #history list, and we return true. Committing a transaction when there have been some undos without corresponding redos will throw away the Transactions holding changes that happened after the current state, before adding the new Transaction to the #history list. @param {string=} tname a short string describing the transaction; this is recorded as the Transaction#name and need not be the same as the string passed to #startTransaction. If the value is an empty string or not supplied, this will use the name given to #startTransaction. @return {boolean} true if ending a top-level transaction. @see #startTransaction @see #rollbackTransaction

Implementation

_i2.bool commitTransaction([_i2.String? tname]) => _i4.callMethod(
      this,
      'commitTransaction',
      [tname ?? _i5.undefined],
    );