Re-enable the export playlist button when any field has changed
This commit is contained in:
parent
0ffa03c6f1
commit
2959876f2b
1 changed files with 13 additions and 8 deletions
|
|
@ -96,6 +96,13 @@ export default {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
payload() {
|
||||||
|
return {
|
||||||
|
name: this.name,
|
||||||
|
description: this.description,
|
||||||
|
public: this.is_public,
|
||||||
|
};
|
||||||
|
},
|
||||||
can_export() {
|
can_export() {
|
||||||
|
|
||||||
// Spotify has a name length of 100 characters, ensure we don't error
|
// Spotify has a name length of 100 characters, ensure we don't error
|
||||||
|
|
@ -104,7 +111,11 @@ export default {
|
||||||
};
|
};
|
||||||
|
|
||||||
if (this.exported_settings) {
|
if (this.exported_settings) {
|
||||||
|
return (
|
||||||
|
this.payload.name != this.exported_settings.name
|
||||||
|
|| this.payload.description != this.exported_settings.description
|
||||||
|
|| this.payload.is_public != this.exported_settings.is_public
|
||||||
|
)
|
||||||
};
|
};
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
@ -112,13 +123,7 @@ export default {
|
||||||
methods: {
|
methods: {
|
||||||
create_playlist() {
|
create_playlist() {
|
||||||
|
|
||||||
// Generate payload object
|
let payload = this.payload
|
||||||
let payload = {
|
|
||||||
name: this.name,
|
|
||||||
description: this.description,
|
|
||||||
public: this.is_public
|
|
||||||
};
|
|
||||||
|
|
||||||
this.exported_settings = payload;
|
this.exported_settings = payload;
|
||||||
|
|
||||||
// Create the Spotify playlist (no tracks yet)
|
// Create the Spotify playlist (no tracks yet)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue