Skip to content

Commit 8ce8e51

Browse files
committed
Use a count rather than a boolean in checking for a localization restart with the message system so that if multiple typesetting messages (or other messages that reuse their id number) are issued before the localization is loaded, we don't lose the clears.
1 parent 3ce040b commit 8ce8e51

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

unpacked/MathJax.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1586,7 +1586,11 @@ MathJax.Message = {
15861586
} catch (err) {
15871587
if (!err.restart) {throw err}
15881588
if (!err.restart.called) {
1589-
this.log[n].restarted = true; // mark it so we can tell if the Clear() comes before the message is up
1589+
//
1590+
// Mark it so we can tell if the Clear() comes before the message is displayed
1591+
//
1592+
if (this.log[n].restarted == null) {this.log[n].restarted = 0}
1593+
this.log[n].restarted++; delete this.log[n].cleared;
15901594
MathJax.Callback.After(["Set",this,text,n,clearDelay],err.restart);
15911595
return n;
15921596
}
@@ -1628,7 +1632,7 @@ MathJax.Message = {
16281632
//
16291633
if (this.log[n].restarted) {
16301634
if (this.log[n].cleared) {clearDelay = 0}
1631-
delete this.log[n].restarted, this.log[n].cleared;
1635+
if (--this.log[n].restarted === 0) {delete this.log[n].cleared}
16321636
}
16331637
//
16341638
// Check if we need to clear the message automatically.

0 commit comments

Comments
 (0)