]> cat aescling's git repositories - mastodon.git/commitdiff
[Glitch] Replace deprecated String.prototype.substr()
authorCommanderRoot <CommanderRoot@users.noreply.github.com>
Mon, 4 Apr 2022 16:19:45 +0000 (18:19 +0200)
committerClaire <claire.github-309c@sitedethib.com>
Wed, 6 Apr 2022 14:08:33 +0000 (16:08 +0200)
Port 0ec695e036dab45d57598f451266bd0b176df9fd to glitch-soc

Signed-off-by: Tobias Speicher <rootcommander@gmail.com>
Signed-off-by: Claire <claire.github-309c@sitedethib.com>
app/javascript/flavours/glitch/features/status/components/card.js
app/javascript/flavours/glitch/features/video/index.js
app/javascript/flavours/glitch/util/emoji/emoji_mart_search_light.js

index 14abe9838ba022ff59e5723f140c95db422dfeda..0ca2508e710d2f75bad2664b71b92e498d847027 100644 (file)
@@ -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();
index 53e3dfda382c4005999e09813b6d7ce8bcebb220..25c94bb2c51554a5fdcc2030c09734ec60a1ea90 100644 (file)
@@ -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
index e4519a13e62266127c91e848e7d0c1fb90c83e4d..70694ab6dde81dc04b5a774f1ef0de197bc9f059 100644 (file)
@@ -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) {