Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: remove random #3

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

fix: remove random #3

wants to merge 1 commit into from

Conversation

chrisemke
Copy link

@chrisemke chrisemke commented Nov 27, 2022

the api already returns a random wallpaper

This PR may be of interest to: @subpop

the api already returns a random wallpaper
Comment on lines +174 to +181
index = root.currentIndex;
if (index > 24) {
root.currentPage += 1;
root.currentIndex = 0;
refreshTimer.restart();
return;
}
root.currentIndex += 1;
Copy link
Author

@chrisemke chrisemke Nov 28, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure, but since we're always going to get the wallpaper from page 1 starting from 0, this part needs to be within the if condition

Suggested change
index = root.currentIndex;
if (index > 24) {
root.currentPage += 1;
root.currentIndex = 0;
refreshTimer.restart();
return;
}
root.currentIndex += 1;
if (wallpaper.configuration.Sorting != "random") {
index = root.currentIndex;
if (index > 24) {
root.currentPage += 1;
root.currentIndex = 0;
refreshTimer.restart();
return;
}
root.currentIndex += 1;
} else {
root.currentPage = 1;
root.currentIndex = 0;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant