mirror of
https://github.com/JonasunderscoreJones/jonasjones.dev.git
synced 2025-10-23 08:59: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
|
* @param {string} str
|
||||||
*/
|
*/
|
||||||
function truncateString(str) {
|
function truncateString(str) {
|
||||||
if (str.length > 29) {
|
const max_length = 27;
|
||||||
return str.slice(0, 29) + "...";
|
if (str.length > max_length) {
|
||||||
|
return str.slice(0, max_length) + "...";
|
||||||
} else {
|
} else {
|
||||||
return str;
|
return str;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue