replace substr to slice
This commit is contained in:
parent
14401b2784
commit
64f5c82c8c
@ -97,7 +97,7 @@ export const ContentInfo = (props: {
|
||||
const subinfoContainer = props.short ? classes.short_subinfoContainer :
|
||||
classes.subinfoContainer;
|
||||
let allTag = document.tags;
|
||||
const artists = allTag.filter(x => x.startsWith("artist:")).map(x => x.substr(7));
|
||||
const artists = allTag.filter(x => x.startsWith("artist:")).map(x => x.slice(7));
|
||||
allTag = allTag.filter(x => !x.startsWith("artist:"));
|
||||
return (<Paper className={propclasses.root || rootName} elevation={4}>
|
||||
<Link className={propclasses.thumbnail_anchor || thumbnail_anchor} component={RouterLink} to={{
|
||||
|
@ -63,10 +63,10 @@ export const TagChip = (props:Omit<ChipProps,"color"> & {tagname: string})=>{
|
||||
let newlabel:string|undefined = undefined;
|
||||
if(typeof label === "string"){
|
||||
if(label.startsWith("female:")){
|
||||
newlabel ="♀ "+label.substr(7);
|
||||
newlabel ="♀ "+label.slice(7);
|
||||
}
|
||||
else if(label.startsWith("male:")){
|
||||
newlabel = "♂ "+label.substr(5);
|
||||
newlabel = "♂ "+label.slice(5);
|
||||
}
|
||||
}
|
||||
return <ColorChip color={getTagColorName(tagname)} label={newlabel||label} {...rest}></ColorChip>;
|
||||
|
Loading…
Reference in New Issue
Block a user