Follow track change when toggle

This commit is contained in:
nemunaire 2022-10-15 13:00:51 +02:00
commit 77bf0ef582
3 changed files with 18 additions and 5 deletions

View file

@ -24,10 +24,9 @@ export class Track {
}
}
toggleEnable() {
async toggleEnable() {
this.enabled = !this.enabled;
this.save();
return this;
return await this.save();
}
async save() {
@ -39,7 +38,7 @@ export class Track {
if (res.status == 200) {
const data = await res.json();
this.update(data);
return data;
return this;
} else {
throw new Error((await res.json()).errmsg);
}