From 311b1d7594cfd03be4d998f4aead041a8ca63f8c Mon Sep 17 00:00:00 2001 From: DIMITRIOS CHRYSOCHERIS Date: Wed, 23 Aug 2023 22:56:08 +0300 Subject: [PATCH] chore: improve checking for API url '/' suffix (#121) --- src/main.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.ts b/src/main.ts index 5999d8d8b..b28f1fb59 100644 --- a/src/main.ts +++ b/src/main.ts @@ -36,8 +36,8 @@ if (apiUrlFromStorage !== null) { } // Make sure the api url does not contain a / at the end -if (window.API_URL.slice(window.API_URL.length - 1, window.API_URL.length) === '/') { - window.API_URL = window.API_URL.slice(0, window.API_URL.length - 1) +if (window.API_URL.endsWith('/')) { + window.API_URL = window.API_URL.slice(0, -1); } // directives