Replace deprecated String.prototype.substr()
String.prototype.substr() is deprecated (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substr) so we replace it with slice() which works similarily but isn't deprecated. Signed-off-by: Tobias Speicher <rootcommander@gmail.com>
This commit is contained in:
parent
59c56cd598
commit
eb46e8f550
4 changed files with 5 additions and 5 deletions
|
@ -2335,7 +2335,7 @@ const app = new Vue({
|
|||
let richsync = [];
|
||||
const lang = app.cfg.lyrics.mxm_language // translation language
|
||||
function revisedRandId() {
|
||||
return Math.random().toString(36).replace(/[^a-z]+/g, '').substr(2, 10);
|
||||
return Math.random().toString(36).replace(/[^a-z]+/g, '').slice(2, 10);
|
||||
}
|
||||
|
||||
/* get token */
|
||||
|
@ -3280,7 +3280,7 @@ const app = new Vue({
|
|||
},
|
||||
async nowPlayingContextMenu(event) {
|
||||
// function revisedRandId() {
|
||||
// return Math.random().toString(36).replace(/[^a-z]+/g, '').substr(2, 10);
|
||||
// return Math.random().toString(36).replace(/[^a-z]+/g, '').slice(2, 10);
|
||||
// }
|
||||
let self = this
|
||||
let data_type = this.mk.nowPlayingItem.playParams.kind
|
||||
|
|
|
@ -90,7 +90,7 @@
|
|||
},
|
||||
methods: {
|
||||
revisedRandId() {
|
||||
return Math.random().toString(36).replace(/[^a-z]+/g, '').substr(2, 10);
|
||||
return Math.random().toString(36).replace(/[^a-z]+/g, '').slice(2, 10);
|
||||
},
|
||||
async isInLibrary() {
|
||||
if (this.item.type && !this.item.type.includes("library")) {
|
||||
|
|
|
@ -140,7 +140,7 @@
|
|||
}
|
||||
},
|
||||
revisedRandId() {
|
||||
return Math.random().toString(36).replace(/[^a-z]+/g, '').substr(2, 10);
|
||||
return Math.random().toString(36).replace(/[^a-z]+/g, '').slice(2, 10);
|
||||
},
|
||||
async isInLibrary() {
|
||||
if (this.item.type && !this.item.type.includes("library")) {
|
||||
|
|
|
@ -153,7 +153,7 @@
|
|||
}
|
||||
},
|
||||
revisedRandId() {
|
||||
return Math.random().toString(36).replace(/[^a-z]+/g, '').substr(2, 10);
|
||||
return Math.random().toString(36).replace(/[^a-z]+/g, '').slice(2, 10);
|
||||
},
|
||||
async isInLibrary() {
|
||||
if (this.item.type && !this.item.type.includes("library")) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue