mirror of
https://github.com/mue/mue.git
synced 2026-07-18 14:34:12 +02:00
fix: tab name language, favourite marketplace backgrounds, birthday greeting message etc
This commit is contained in:
@@ -82,23 +82,26 @@ export default class Background extends PureComponent {
|
||||
offline = true;
|
||||
}
|
||||
|
||||
const setFavourited = (favourited) => {
|
||||
this.setState({
|
||||
url: favourited.url,
|
||||
photoInfo: {
|
||||
credit: favourited.credit,
|
||||
location: favourited.location,
|
||||
camera: favourited.camera
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
switch (localStorage.getItem('backgroundType')) {
|
||||
case 'api':
|
||||
if (offline) {
|
||||
return this.setState(offlineBackground());
|
||||
}
|
||||
|
||||
// favourite button
|
||||
const favourited = JSON.parse(localStorage.getItem('favourite'));
|
||||
if (favourited) {
|
||||
return this.setState({
|
||||
url: favourited.url,
|
||||
photoInfo: {
|
||||
credit: favourited.credit,
|
||||
location: favourited.location,
|
||||
camera: favourited.camera
|
||||
}
|
||||
});
|
||||
return setFavourited(favourited);
|
||||
}
|
||||
|
||||
// API background
|
||||
@@ -205,6 +208,11 @@ export default class Background extends PureComponent {
|
||||
return this.setState(offlineBackground());
|
||||
}
|
||||
|
||||
const photofavourited = JSON.parse(localStorage.getItem('favourite'));
|
||||
if (photofavourited) {
|
||||
return setFavourited(photofavourited);
|
||||
}
|
||||
|
||||
const photoPack = JSON.parse(localStorage.getItem('photo_packs'));
|
||||
if (photoPack) {
|
||||
const randomPhoto = photoPack[Math.floor(Math.random() * photoPack.length)];
|
||||
|
||||
Reference in New Issue
Block a user