feat: don't get the same image twice in a row

Works with Mue API only, not Unsplash and not photo packs.
This commit is contained in:
Isaac
2022-11-21 17:11:16 +00:00
parent 59aa73d333
commit 668928cbff

View File

@@ -94,7 +94,13 @@ export default class Background extends PureComponent {
const backgroundAPI = localStorage.getItem('backgroundAPI');
const apiQuality = localStorage.getItem('apiQuality');
const backgroundExclude = JSON.parse(localStorage.getItem('backgroundExclude'));
let backgroundExclude = JSON.parse(localStorage.getItem('backgroundExclude'));
if (!Array.isArray(backgroundExclude)) {
backgroundExclude = [];
}
if (this.state.photoInfo.pun) {
backgroundExclude.push(this.state.photoInfo.pun)
}
let requestURL, data;
switch (backgroundAPI) {