mirror of
https://github.com/mue/mue.git
synced 2026-07-26 18:21:27 +02:00
fix: many bug fixes and some performance improvements
Co-authored-by: Alex Sparkes <turbomarshmello@gmail.com>
This commit is contained in:
@@ -9,15 +9,15 @@ export default class Favourite extends React.PureComponent {
|
||||
constructor() {
|
||||
super();
|
||||
this.state = {
|
||||
favourited: (localStorage.getItem('favourite')) ? <StarIcon onClick={() => this.favourite()} className='topicons' /> : <StarIcon2 onClick={() => this.favourite()} className='topicons' />
|
||||
favourited: (localStorage.getItem('favourite')) ? <StarIcon onClick={this.favourite} className='topicons' /> : <StarIcon2 onClick={this.favourite} className='topicons' />
|
||||
};
|
||||
}
|
||||
|
||||
favourite() {
|
||||
favourite = () => {
|
||||
if (localStorage.getItem('favourite')) {
|
||||
localStorage.removeItem('favourite');
|
||||
this.setState({
|
||||
favourited: <StarIcon2 onClick={() => this.favourite()} className='topicons' />
|
||||
favourited: <StarIcon2 onClick={this.favourite} className='topicons' />
|
||||
});
|
||||
} else {
|
||||
const url = document.getElementById('backgroundImage').style.backgroundImage.replace('url("', '').replace('")', '');
|
||||
@@ -26,13 +26,13 @@ export default class Favourite extends React.PureComponent {
|
||||
localStorage.setItem('favourite', JSON.stringify({ url: url, credit: credit }));
|
||||
|
||||
this.setState({
|
||||
favourited: <StarIcon onClick={() => this.favourite()} className='topicons' />
|
||||
favourited: <StarIcon onClick={this.favourite} className='topicons' />
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
if (localStorage.getItem('background') === 'false' || localStorage.getItem('customBackgroundColour') || localStorage.getItem('customBackground')) {
|
||||
if (localStorage.getItem('backgroundType') === 'colour') {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user