From efd4ac8104bbb17390b245b52b24f9ae0bc195df Mon Sep 17 00:00:00 2001 From: trisua Date: Sun, 22 Jun 2025 14:11:15 -0400 Subject: [PATCH] fix: spotify connection --- crates/app/src/public/html/auth/connection.lisp | 4 +++- crates/app/src/public/html/profile/base.lisp | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/crates/app/src/public/html/auth/connection.lisp b/crates/app/src/public/html/auth/connection.lisp index 905b215..8c4fcef 100644 --- a/crates/app/src/public/html/auth/connection.lisp +++ b/crates/app/src/public/html/auth/connection.lisp @@ -12,6 +12,7 @@ (text "{% if connection_type == \"Spotify\" and user and user.connections.Spotify and config.connections.spotify_client_id %}") (script + ("defer" "true") (text "setTimeout(async () => { const code = new URLSearchParams(window.location.search).get(\"code\"); const client_id = \"{{ config.connections.spotify_client_id }}\"; @@ -46,10 +47,11 @@ setTimeout(() => { window.location.href = \"/settings#/connections\"; }, 500); - }, 150);")) + }, 1000);")) (text "{% elif connection_type == \"LastFm\" and user and user.connections.LastFm and config.connections.last_fm_key %}") (script + ("defer" "true") (text "setTimeout(async () => { const token = new URLSearchParams(window.location.search).get(\"token\"); const api_key = \"{{ config.connections.last_fm_key }}\"; diff --git a/crates/app/src/public/html/profile/base.lisp b/crates/app/src/public/html/profile/base.lisp index 5e846ff..7718eea 100644 --- a/crates/app/src/public/html/profile/base.lisp +++ b/crates/app/src/public/html/profile/base.lisp @@ -132,9 +132,11 @@ (text "{{ profile.settings.biography|markdown|safe }}")) (div ("class" "card flex flex-col gap-2") + (text "{% if user -%}") (div ("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 "{%- endif %}") (div ("class" "w-full flex justify-between items-center") (span