mirror of
https://github.com/mue/mue.git
synced 2026-07-19 23:14:10 +02:00
feat: fully working hot reload for weather and search
This commit is contained in:
@@ -89,13 +89,6 @@ export default class Weather extends React.PureComponent {
|
||||
componentDidMount() {
|
||||
EventBus.on('refresh', (data) => {
|
||||
if (data === 'weather') {
|
||||
const element = document.querySelector('.weather');
|
||||
|
||||
if (localStorage.getItem('weatherEnabled') === 'false') {
|
||||
return element.style.display = 'none';
|
||||
}
|
||||
|
||||
element.style.display = 'block';
|
||||
this.getWeather();
|
||||
}
|
||||
});
|
||||
@@ -103,6 +96,10 @@ export default class Weather extends React.PureComponent {
|
||||
this.getWeather();
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
EventBus.remove('refresh');
|
||||
}
|
||||
|
||||
render() {
|
||||
const enabled = (setting) => {
|
||||
return (localStorage.getItem(setting) === 'true');
|
||||
|
||||
Reference in New Issue
Block a user