From 88f89ceb0f88ca0cdf5c4d820509ab8fe74fcf62 Mon Sep 17 00:00:00 2001 From: J-onasJones Date: Tue, 26 Sep 2023 17:17:31 +0200 Subject: [PATCH] Fix: Track title overflow Fixed an issue where the lastfm track title would overflow and cover the artist --- src/components/NavBar.svelte | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/NavBar.svelte b/src/components/NavBar.svelte index 8c71ede..08f0e96 100644 --- a/src/components/NavBar.svelte +++ b/src/components/NavBar.svelte @@ -26,8 +26,9 @@ * @param {string} str */ function truncateString(str) { - if (str.length > 29) { - return str.slice(0, 29) + "..."; + const max_length = 27; + if (str.length > max_length) { + return str.slice(0, max_length) + "..."; } else { return str; }