about summary refs log tree commit diff
path: root/app/javascript/flavours/glitch/features
diff options
context:
space:
mode:
authorCommanderRoot <CommanderRoot@users.noreply.github.com>2022-04-04 18:19:45 +0200
committerClaire <claire.github-309c@sitedethib.com>2022-04-06 16:08:33 +0200
commit9b95077885c4a7c03e9f4124f81cd39e2c6cbf26 (patch)
tree1f53d6804f4a4b81e51729f988cd2e76d0058bab /app/javascript/flavours/glitch/features
parentc02644ef10ba55a3b1af2fcc4e1780a940c0369f (diff)
[Glitch] Replace deprecated String.prototype.substr()
Port 0ec695e036dab45d57598f451266bd0b176df9fd to glitch-soc

Signed-off-by: Tobias Speicher <rootcommander@gmail.com>
Signed-off-by: Claire <claire.github-309c@sitedethib.com>
Diffstat (limited to 'app/javascript/flavours/glitch/features')
-rw-r--r--app/javascript/flavours/glitch/features/status/components/card.js2
-rw-r--r--app/javascript/flavours/glitch/features/video/index.js2
2 files changed, 2 insertions, 2 deletions
diff --git a/app/javascript/flavours/glitch/features/status/components/card.js b/app/javascript/flavours/glitch/features/status/components/card.js
index 14abe9838..0ca2508e7 100644
--- a/app/javascript/flavours/glitch/features/status/components/card.js
+++ b/app/javascript/flavours/glitch/features/status/components/card.js
@@ -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();
diff --git a/app/javascript/flavours/glitch/features/video/index.js b/app/javascript/flavours/glitch/features/video/index.js
index 53e3dfda3..25c94bb2c 100644
--- a/app/javascript/flavours/glitch/features/video/index.js
+++ b/app/javascript/flavours/glitch/features/video/index.js
@@ -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