mirror of
https://github.com/mue/mue.git
synced 2026-07-17 05:54:14 +02:00
fix: marketplace sort and widget zoom breaking analogue clock
This commit is contained in:
@@ -7,7 +7,7 @@ export default function Items(props) {
|
||||
<div className='item' onClick={() => props.toggleFunction(item.name)} key={item.name}>
|
||||
<img alt='icon' draggable='false' src={window.constants.DDG_PROXY + item.icon_url} />
|
||||
<div className='details'>
|
||||
<h4>{item.display_name ? item.display_name : item.name}</h4>
|
||||
<h4>{item.display_name || item.name}</h4>
|
||||
<p>{item.author}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -4,7 +4,7 @@ export default function Lightbox(props) {
|
||||
return (
|
||||
<>
|
||||
<span className='closeModal' onClick={props.modalClose}>×</span>
|
||||
<img src={props.img} className='lightboximg' draggable={false} alt='Item'/>
|
||||
<img src={props.img} className='lightboximg' draggable={false} alt='Item screenshot'/>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -110,7 +110,10 @@ export default class Marketplace extends React.PureComponent {
|
||||
switch (value) {
|
||||
case 'a-z':
|
||||
items.sort();
|
||||
items.reverse();
|
||||
// fix sort not working sometimes
|
||||
if (this.state.sortType === 'z-a') {
|
||||
items.reverse();
|
||||
}
|
||||
break;
|
||||
case 'z-a':
|
||||
items.sort();
|
||||
@@ -121,10 +124,9 @@ export default class Marketplace extends React.PureComponent {
|
||||
}
|
||||
|
||||
this.setState({
|
||||
items: items
|
||||
items: items,
|
||||
sortType: value
|
||||
});
|
||||
|
||||
this.forceUpdate();
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
|
||||
@@ -102,7 +102,9 @@ export default class TimeSettings extends React.PureComponent {
|
||||
<option value='percentageComplete'>{time.percentage_complete}</option>
|
||||
</Dropdown>
|
||||
{timeSettings}
|
||||
<Slider title={window.language.modals.main.settings.sections.appearance.accessibility.widget_zoom} name='zoomClock' min='10' max='400' default='100' display='%' category='clock' element='.clock-container' />
|
||||
{this.state.timeType !== 'analogue' ?
|
||||
<Slider title={window.language.modals.main.settings.sections.appearance.accessibility.widget_zoom} name='zoomClock' min='10' max='400' default='100' display='%' category='clock' element='.clock-container' />
|
||||
: null }
|
||||
|
||||
<h3>{time.date.title}</h3>
|
||||
<Switch name='date' text={this.language.enabled} category='date' element='.date'/>
|
||||
|
||||
@@ -104,7 +104,9 @@ export default class Clock extends React.PureComponent {
|
||||
}
|
||||
});
|
||||
|
||||
document.querySelector('.clock-container').style.fontSize = `${4 * Number((localStorage.getItem('zoomClock') || 100) / 100)}em`;
|
||||
if (localStorage.getItem('timeType') !== 'analogue') {
|
||||
document.querySelector('.clock-container').style.fontSize = `${4 * Number((localStorage.getItem('zoomClock') || 100) / 100)}em`;
|
||||
}
|
||||
|
||||
this.startTime(0);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user