add spotify button based on sync id
This commit is contained in:
parent
1b21009ebb
commit
6212f47084
1 changed files with 7 additions and 2 deletions
|
@ -167,7 +167,7 @@ function buildActivityHTML(activity) {
|
||||||
: "";
|
: "";
|
||||||
|
|
||||||
const activityButtons =
|
const activityButtons =
|
||||||
activity.buttons && activity.buttons.length > 0
|
(activity.buttons && activity.buttons.length > 0
|
||||||
? `<div class="activity-buttons">
|
? `<div class="activity-buttons">
|
||||||
${activity.buttons
|
${activity.buttons
|
||||||
.map((button, index) => {
|
.map((button, index) => {
|
||||||
|
@ -188,7 +188,12 @@ function buildActivityHTML(activity) {
|
||||||
.filter(Boolean)
|
.filter(Boolean)
|
||||||
.join("")}
|
.join("")}
|
||||||
</div>`
|
</div>`
|
||||||
: "";
|
: "") +
|
||||||
|
(activity.name === "Spotify" && activity.sync_id
|
||||||
|
? `<div class="activity-buttons">
|
||||||
|
<a href="https://open.spotify.com/track/${activity.sync_id}" class="activity-button" target="_blank" rel="noopener noreferrer">Listen on Spotify</a>
|
||||||
|
</div>`
|
||||||
|
: "");
|
||||||
|
|
||||||
const progressBar =
|
const progressBar =
|
||||||
progress !== null
|
progress !== null
|
||||||
|
|
Loading…
Add table
Reference in a new issue