fix asynchronization conflict

This commit is contained in:
DIYgod 2018-03-14 00:25:54 +08:00
parent 10d49c275a
commit 454019fea0
No known key found for this signature in database
GPG Key ID: EC0B76A252D3EF67
1 changed files with 1 additions and 1 deletions

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);
}