mirror of
https://framagit.org/tykayn/mastodon.git
synced 2023-08-25 08:33:12 +02:00
[Glitch] Replace deprecated String.prototype.substr()
Port 0ec695e036
to glitch-soc
Signed-off-by: Tobias Speicher <rootcommander@gmail.com>
Signed-off-by: Claire <claire.github-309c@sitedethib.com>
This commit is contained in:
parent
c02644ef10
commit
9b95077885
@ -24,7 +24,7 @@ const trim = (text, len) => {
|
||||
return text;
|
||||
}
|
||||
|
||||
return text.substring(0, cut) + (text.length > len ? '…' : '');
|
||||
return text.slice(0, cut) + (text.length > len ? '…' : '');
|
||||
};
|
||||
|
||||
const domParser = new DOMParser();
|
||||
|
@ -90,7 +90,7 @@ export const fileNameFromURL = str => {
|
||||
const pathname = url.pathname;
|
||||
const index = pathname.lastIndexOf('/');
|
||||
|
||||
return pathname.substring(index + 1);
|
||||
return pathname.slice(index + 1);
|
||||
};
|
||||
|
||||
export default @injectIntl
|
||||
|
@ -124,7 +124,7 @@ function search(value, { emojisToShowFilter, maxResults, include, exclude, custo
|
||||
for (let id in aPool) {
|
||||
let emoji = aPool[id],
|
||||
{ search } = emoji,
|
||||
sub = value.substr(0, length),
|
||||
sub = value.slice(0, length),
|
||||
subIndex = search.indexOf(sub);
|
||||
|
||||
if (subIndex !== -1) {
|
||||
|
Loading…
Reference in New Issue
Block a user