Follow track change when toggle
This commit is contained in:
parent
3926dddf39
commit
77bf0ef582
3 changed files with 18 additions and 5 deletions
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue