Moving term state changing to earlier in terminate call
This commit is contained in:
6643
dist/scorm-again.js
vendored
6643
dist/scorm-again.js
vendored
File diff suppressed because one or more lines are too long
@@ -106,6 +106,7 @@ export default class BaseAPI {
|
|||||||
if (this.checkState(checkTerminated,
|
if (this.checkState(checkTerminated,
|
||||||
this.#error_codes.TERMINATION_BEFORE_INIT,
|
this.#error_codes.TERMINATION_BEFORE_INIT,
|
||||||
this.#error_codes.MULTIPLE_TERMINATION)) {
|
this.#error_codes.MULTIPLE_TERMINATION)) {
|
||||||
|
this.currentState = global_constants.STATE_TERMINATED;
|
||||||
const result = this.storeData(true);
|
const result = this.storeData(true);
|
||||||
if (result.errorCode && result.errorCode > 0) {
|
if (result.errorCode && result.errorCode > 0) {
|
||||||
this.throwSCORMError(result.errorCode);
|
this.throwSCORMError(result.errorCode);
|
||||||
@@ -114,7 +115,6 @@ export default class BaseAPI {
|
|||||||
result.result : global_constants.SCORM_FALSE;
|
result.result : global_constants.SCORM_FALSE;
|
||||||
|
|
||||||
if (checkTerminated) this.lastErrorCode = 0;
|
if (checkTerminated) this.lastErrorCode = 0;
|
||||||
this.currentState = global_constants.STATE_TERMINATED;
|
|
||||||
returnValue = global_constants.SCORM_TRUE;
|
returnValue = global_constants.SCORM_TRUE;
|
||||||
this.processListeners(callbackName);
|
this.processListeners(callbackName);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user