Skip to content

Commit

Permalink
refactor: replace deprecated String.prototype.substr() (#735)
Browse files Browse the repository at this point in the history
.substr() is deprecated so we replace it with .slice() which works similarily but isn't deprecated

Signed-off-by: Tobias Speicher <[email protected]>
  • Loading branch information
CommanderRoot authored Mar 23, 2022
1 parent 180540f commit 480543e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions app/features/app/components/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion app/features/welcome/components/Welcome.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ class Welcome extends Component<Props, State> {
*/
_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
Expand Down

0 comments on commit 480543e

Please sign in to comment.