mirror of
https://github.com/JonasunderscoreJones/jonasjones.dev.git
synced 2025-10-23 00:49:19 +02:00
Fix: Track title overflow
Fixed an issue where the lastfm track title would overflow and cover the artist
This commit is contained in:
parent
fafa5ca29a
commit
88f89ceb0f
1 changed files with 3 additions and 2 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue