feat: welcome modal language hot reload

This commit is contained in:
David Ralph
2021-07-18 10:59:38 +01:00
parent 99993720f2
commit 332e6c33ac
3 changed files with 38 additions and 2 deletions

View File

@@ -283,7 +283,16 @@ export default class Background extends React.PureComponent {
this.getBackground();
};
const welcomeTab = localStorage.getItem('welcomeTab');
if (welcomeTab) {
return this.setState(JSON.parse(localStorage.getItem('welcomeImage')));
}
EventBus.on('refresh', (data) => {
if (data === 'welcomeLanguage') {
localStorage.setItem('welcomeImage', JSON.stringify(this.state));
}
if (data === 'background') {
if (localStorage.getItem('background') === 'false') {
// user is using custom colour or image