From 480543e8616d50c89dcb23d541eb1aec51f5f201 Mon Sep 17 00:00:00 2001 From: CommanderRoot Date: Wed, 23 Mar 2022 21:06:37 +0100 Subject: [PATCH] refactor: replace deprecated String.prototype.substr() (#735) .substr() is deprecated so we replace it with .slice() which works similarily but isn't deprecated Signed-off-by: Tobias Speicher --- app/features/app/components/App.js | 4 ++-- app/features/welcome/components/Welcome.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/features/app/components/App.js b/app/features/app/components/App.js index c34bbbfed..7164b0457 100644 --- a/app/features/app/components/App.js +++ b/app/features/app/components/App.js @@ -69,8 +69,8 @@ class App extends Component<*> { */ _listenOnProtocolMessages(event, inputURL: string) { // Remove trailing slash if one exists. - if (inputURL.substr(-1) === '/') { - inputURL = inputURL.substr(0, inputURL.length - 1); // eslint-disable-line no-param-reassign + if (inputURL.slice(-1) === '/') { + inputURL = inputURL.slice(0, -1); // eslint-disable-line no-param-reassign } const conference = createConferenceObjectFromURL(inputURL); diff --git a/app/features/welcome/components/Welcome.js b/app/features/welcome/components/Welcome.js index d5a7090e2..0dad33012 100644 --- a/app/features/welcome/components/Welcome.js +++ b/app/features/welcome/components/Welcome.js @@ -162,7 +162,7 @@ class Welcome extends Component { */ _animateRoomnameChanging(word: string) { let animateTimeoutId; - const roomPlaceholder = this.state.roomPlaceholder + word.substr(0, 1); + const roomPlaceholder = this.state.roomPlaceholder + word.slice(0, 1); if (word.length > 1) { animateTimeoutId