From 9af0138beea9e48627e2368068c19fd01a0522b9 Mon Sep 17 00:00:00 2001 From: Tobias Speicher Date: Fri, 18 Mar 2022 02:19:22 +0100 Subject: [PATCH] chore: replace deprecated String.prototype.substr() .substr() is deprecated so we replace it with .slice() which works similarily but isn't deprecated Signed-off-by: Tobias Speicher --- src/utils/js/api.dev.js | 2 +- src/utils/js/api.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils/js/api.dev.js b/src/utils/js/api.dev.js index 073b279..5114431 100644 --- a/src/utils/js/api.dev.js +++ b/src/utils/js/api.dev.js @@ -80,7 +80,7 @@ export function startLogin(callbackUrl) { export function continueLogin() { if ( /^\?login=/.test(window.location.search) ) { return delay(2000).then(() => { - setTimeout(() => window.location = decodeURIComponent(window.location.search.substr(7), 100)); + setTimeout(() => window.location = decodeURIComponent(window.location.search.slice(7), 100)); return 'developer'; }); } diff --git a/src/utils/js/api.js b/src/utils/js/api.js index 441fb10..19ffd2c 100644 --- a/src/utils/js/api.js +++ b/src/utils/js/api.js @@ -34,7 +34,7 @@ export function continueLogin() { return login(match[1], match[2]).then(result => { setTimeout(() => { let href = window.location.href; - window.location = href.substr(0, href.length - window.location.search.length); + window.location = href.slice(0, href.length - window.location.search.length); }, 100); return result;