mirror of
https://github.com/mue/mue.git
synced 2026-07-16 21:44:22 +02:00
feat: new refresh button options
This commit is contained in:
@@ -309,7 +309,7 @@ export default class Background extends PureComponent {
|
||||
}
|
||||
|
||||
// uninstall photo pack reverts your background to what you had previously
|
||||
if (data === 'marketplacebackgrounduninstall' || data === 'backgroundwelcome') {
|
||||
if (data === 'marketplacebackgrounduninstall' || data === 'backgroundwelcome' || data === 'backgroundrefresh') {
|
||||
refresh();
|
||||
}
|
||||
});
|
||||
|
||||
@@ -14,6 +14,7 @@ export default class Navbar extends PureComponent {
|
||||
constructor() {
|
||||
super();
|
||||
this.navbarContainer = createRef();
|
||||
this.refreshValue = localStorage.getItem('refresh');
|
||||
}
|
||||
|
||||
setZoom() {
|
||||
@@ -32,6 +33,23 @@ export default class Navbar extends PureComponent {
|
||||
this.setZoom();
|
||||
}
|
||||
|
||||
refresh() {
|
||||
switch (this.refreshValue) {
|
||||
case 'background':
|
||||
EventBus.dispatch('refresh', 'backgroundrefresh');
|
||||
break;
|
||||
case 'quote':
|
||||
EventBus.dispatch('refresh', 'quoterefresh');
|
||||
break;
|
||||
case 'quotebackground':
|
||||
EventBus.dispatch('refresh', 'quoterefresh');
|
||||
EventBus.dispatch('refresh', 'backgroundrefresh');
|
||||
break;
|
||||
default:
|
||||
window.location.reload();
|
||||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
const backgroundEnabled = (localStorage.getItem('background') === 'true');
|
||||
|
||||
@@ -53,9 +71,9 @@ export default class Navbar extends PureComponent {
|
||||
</Tooltip>
|
||||
: null}
|
||||
|
||||
{(localStorage.getItem('refresh') === 'true') ?
|
||||
{(this.refreshValue !== 'false') ?
|
||||
<Tooltip title={window.language.widgets.navbar.tooltips.refresh}>
|
||||
<RefreshRounded className='refreshicon topicons' onClick={() => window.location.reload()}/>
|
||||
<RefreshRounded className='refreshicon topicons' onClick={() => this.refresh()}/>
|
||||
</Tooltip>
|
||||
: null}
|
||||
|
||||
|
||||
@@ -226,6 +226,10 @@ export default class Quote extends PureComponent {
|
||||
if (data === 'marketplacequoteuninstall') {
|
||||
this.init();
|
||||
}
|
||||
|
||||
if (data === 'quoterefresh') {
|
||||
this.getQuote();
|
||||
}
|
||||
});
|
||||
|
||||
const interval = localStorage.getItem('quotechange');
|
||||
|
||||
Reference in New Issue
Block a user