fix asynchronization conflict

This commit is contained in:
DIYgod
2018-03-14 00:25:54 +08:00
parent 10d49c275a
commit 454019fea0
+1 -1
View File
@@ -39,7 +39,7 @@ class Lrc {
this.parsed[index] = [['00:00', 'Loading']];
const xhr = new XMLHttpRequest();
xhr.onreadystatechange = () => {
if (xhr.readyState === 4) {
if (index === this.player.playIndex && xhr.readyState === 4) {
if (xhr.status >= 200 && xhr.status < 300 || xhr.status === 304) {
this.parsed[index] = this.parse(xhr.responseText);
}