fix: spotify connection
This commit is contained in:
parent
2f83497f98
commit
efd4ac8104
2 changed files with 5 additions and 1 deletions
|
@ -12,6 +12,7 @@
|
||||||
|
|
||||||
(text "{% if connection_type == \"Spotify\" and user and user.connections.Spotify and config.connections.spotify_client_id %}")
|
(text "{% if connection_type == \"Spotify\" and user and user.connections.Spotify and config.connections.spotify_client_id %}")
|
||||||
(script
|
(script
|
||||||
|
("defer" "true")
|
||||||
(text "setTimeout(async () => {
|
(text "setTimeout(async () => {
|
||||||
const code = new URLSearchParams(window.location.search).get(\"code\");
|
const code = new URLSearchParams(window.location.search).get(\"code\");
|
||||||
const client_id = \"{{ config.connections.spotify_client_id }}\";
|
const client_id = \"{{ config.connections.spotify_client_id }}\";
|
||||||
|
@ -46,10 +47,11 @@
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
window.location.href = \"/settings#/connections\";
|
window.location.href = \"/settings#/connections\";
|
||||||
}, 500);
|
}, 500);
|
||||||
}, 150);"))
|
}, 1000);"))
|
||||||
|
|
||||||
(text "{% elif connection_type == \"LastFm\" and user and user.connections.LastFm and config.connections.last_fm_key %}")
|
(text "{% elif connection_type == \"LastFm\" and user and user.connections.LastFm and config.connections.last_fm_key %}")
|
||||||
(script
|
(script
|
||||||
|
("defer" "true")
|
||||||
(text "setTimeout(async () => {
|
(text "setTimeout(async () => {
|
||||||
const token = new URLSearchParams(window.location.search).get(\"token\");
|
const token = new URLSearchParams(window.location.search).get(\"token\");
|
||||||
const api_key = \"{{ config.connections.last_fm_key }}\";
|
const api_key = \"{{ config.connections.last_fm_key }}\";
|
||||||
|
|
|
@ -132,9 +132,11 @@
|
||||||
(text "{{ profile.settings.biography|markdown|safe }}"))
|
(text "{{ profile.settings.biography|markdown|safe }}"))
|
||||||
(div
|
(div
|
||||||
("class" "card flex flex-col gap-2")
|
("class" "card flex flex-col gap-2")
|
||||||
|
(text "{% if user -%}")
|
||||||
(div
|
(div
|
||||||
("style" "display: contents;")
|
("style" "display: contents;")
|
||||||
(text "{% if profile.connections.Spotify and profile.connections.Spotify[0].data.name -%} {{ components::spotify_playing(state=profile.connections.Spotify[1]) }} {% elif profile.connections.LastFm and profile.connections.LastFm[0].data.name %} {{ components::last_fm_playing(state=profile.connections.LastFm[1]) }} {%- endif %}"))
|
(text "{% if profile.connections.Spotify and profile.connections.Spotify[0].data.name -%} {{ components::spotify_playing(state=profile.connections.Spotify[1]) }} {% elif profile.connections.LastFm and profile.connections.LastFm[0].data.name %} {{ components::last_fm_playing(state=profile.connections.LastFm[1]) }} {%- endif %}"))
|
||||||
|
(text "{%- endif %}")
|
||||||
(div
|
(div
|
||||||
("class" "w-full flex justify-between items-center")
|
("class" "w-full flex justify-between items-center")
|
||||||
(span
|
(span
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue