Prechádzať zdrojové kódy

Merge pull request #757 from smiclea/fix-duplicated-url

Remove duplicated URL in error notification
Daniel Vincze 3 rokov pred
rodič
commit
223056dc92
1 zmenil súbory, kde vykonal 1 pridanie a 2 odobranie
  1. 1 2
      src/utils/ApiCallerHandlers.ts

+ 1 - 2
src/utils/ApiCallerHandlers.ts

@@ -9,9 +9,8 @@ const isOnLoginPage = (): boolean =>
 const truncateUrl = (url: string): string => {
   const MAX_LENGTH = 100;
   let relativePath = url.replace(/http(s)?:\/\/.*?\//, "/");
-  relativePath += relativePath;
   if (relativePath.length > MAX_LENGTH) {
-    relativePath = `${relativePath.substr(0, MAX_LENGTH)}...`;
+    relativePath = `${relativePath.substring(0, MAX_LENGTH)}...`;
   }
   return relativePath;
 };