use substring over slice for strings

This commit is contained in:
siikamiika 2019-12-06 14:58:42 +02:00
parent a5a6351cce
commit d1950bc5f1

View File

@ -360,7 +360,7 @@ class DisplaySearch extends Display {
setTitleText(text) { setTitleText(text) {
// Chrome limits title to 1024 characters // Chrome limits title to 1024 characters
if (text.length > 1000) { if (text.length > 1000) {
text = text.slice(0, 1000) + '...'; text = text.substring(0, 1000) + '...';
} }
if (text.length === 0) { if (text.length === 0) {