0
0
Fork 0

Re-enable the export playlist button when any field has changed

This commit is contained in:
Oliver-Akins 2020-08-18 18:47:33 -06:00
parent 0ffa03c6f1
commit 2959876f2b

View file

@ -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)