Moving term state changing to earlier in terminate call

This commit is contained in:
Jonathan Putney
2019-12-26 13:03:43 -05:00
parent a084f35f0e
commit bbe30d4ab0
2 changed files with 3719 additions and 2926 deletions

6643
dist/scorm-again.js vendored

File diff suppressed because one or more lines are too long

View File

@@ -106,6 +106,7 @@ export default class BaseAPI {
if (this.checkState(checkTerminated,
this.#error_codes.TERMINATION_BEFORE_INIT,
this.#error_codes.MULTIPLE_TERMINATION)) {
this.currentState = global_constants.STATE_TERMINATED;
const result = this.storeData(true);
if (result.errorCode && result.errorCode > 0) {
this.throwSCORMError(result.errorCode);
@@ -114,7 +115,6 @@ export default class BaseAPI {
result.result : global_constants.SCORM_FALSE;
if (checkTerminated) this.lastErrorCode = 0;
this.currentState = global_constants.STATE_TERMINATED;
returnValue = global_constants.SCORM_TRUE;
this.processListeners(callbackName);
}