sforkowany z mirror/social
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 <rootcommander@gmail.com>feature/145/mastodon-api
rodzic
d239b379e2
commit
11f437135a
|
@ -30,6 +30,6 @@ const getSearchParams = url => {
|
||||||
}, {})
|
}, {})
|
||||||
}
|
}
|
||||||
|
|
||||||
const randHash = () => Math.random().toString(36).replace(/[^a-z]+/g, '').substr(0, 10)
|
const randHash = () => Math.random().toString(36).replace(/[^a-z]+/g, '').slice(0, 10)
|
||||||
|
|
||||||
export default { getSearchParams, randHash }
|
export default { getSearchParams, randHash }
|
||||||
|
|
|
@ -67,7 +67,7 @@ function transformText(createElement, text) {
|
||||||
props: {
|
props: {
|
||||||
to: {
|
to: {
|
||||||
name: 'profile',
|
name: 'profile',
|
||||||
params: { account: match[2].substr(1) }
|
params: { account: match[2].slice(1) }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -85,7 +85,7 @@ function transformText(createElement, text) {
|
||||||
props: {
|
props: {
|
||||||
to: {
|
to: {
|
||||||
name: 'tags',
|
name: 'tags',
|
||||||
params: { tag: match[2].substr(1) }
|
params: { tag: match[2].slice(1) }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -139,7 +139,7 @@ function cleanLink(createElement, node, context) {
|
||||||
props: {
|
props: {
|
||||||
to: {
|
to: {
|
||||||
name: 'tags',
|
name: 'tags',
|
||||||
params: { tag: node.textContent.substr(1) }
|
params: { tag: node.textContent.slice(1) }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -128,7 +128,7 @@ export default {
|
||||||
computed: {
|
computed: {
|
||||||
localUid() {
|
localUid() {
|
||||||
// Returns only the local part of a username
|
// Returns only the local part of a username
|
||||||
return (this.uid.indexOf('@') === -1) ? this.uid : this.uid.substr(0, this.uid.indexOf('@'))
|
return (this.uid.indexOf('@') === -1) ? this.uid : this.uid.slice(0, this.uid.indexOf('@'))
|
||||||
},
|
},
|
||||||
displayName() {
|
displayName() {
|
||||||
if (typeof this.accountInfo.name !== 'undefined' && this.accountInfo.name !== '') {
|
if (typeof this.accountInfo.name !== 'undefined' && this.accountInfo.name !== '') {
|
||||||
|
|
|
@ -62,7 +62,7 @@ export default {
|
||||||
* @returns {String}
|
* @returns {String}
|
||||||
*/
|
*/
|
||||||
account() {
|
account() {
|
||||||
return window.location.href.split('/')[window.location.href.split('/').length - 2].substr(1)
|
return window.location.href.split('/')[window.location.href.split('/').length - 2].slice(1)
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* @description Returns the timeline currently loaded in the store
|
* @description Returns the timeline currently loaded in the store
|
||||||
|
|
Ładowanie…
Reference in New Issue