fix: addons not being uninstalled correctly

This commit is contained in:
Isaac
2022-08-24 21:41:22 +01:00
parent 484d16122c
commit b93302153e
2 changed files with 27 additions and 21 deletions

View File

@@ -244,7 +244,13 @@ export default class Background extends PureComponent {
return setFavourited(photofavourited);
}
const photoPack = JSON.parse(localStorage.getItem('photo_packs'));
const photoPack = [];
const installed = JSON.parse(localStorage.getItem('installed'));
installed.forEach(item => {
if (item.type === 'photos') {
photoPack.push(...item.photos)
}
});
if (photoPack) {
const randomPhoto = photoPack[Math.floor(Math.random() * photoPack.length)];
return this.setState({