Skip to content

Commit

Permalink
Fixed bug were waiting icons weren't showing
Browse files Browse the repository at this point in the history
  • Loading branch information
elrumo committed May 24, 2021
1 parent a09e8a9 commit 6e31c9a
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions website/macos-big-sur-icons/src/store/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ export default new Vuex.Store({
approved: [],
notApproved: [],
hacked: [],
toSkip: 0,
toSkip: {
approved: 0,
notApproved: 0
},
count: {
approved: 0,
notApproved: 0,
Expand Down Expand Up @@ -113,7 +116,8 @@ export default new Vuex.Store({
store.state.userIcons.approved = [];
store.state.userIcons.notApproved = [];
store.state.userIcons.hacked = [];
store.state.userIcons.toSkip = 0;
store.state.userIcons.toSkip.approved = 0;
store.state.userIcons.toSkip.notApproved = 0;
},

pushDataToArr(store, iconData){
Expand Down Expand Up @@ -262,9 +266,9 @@ export default new Vuex.Store({
approvedQuery.equalTo("user", userObj);
approvedQuery.equalTo("approved", true);
approvedQuery.exists("icnsFile");
approvedQuery.skip(store.state.userIcons.toSkip)
approvedQuery.skip(store.state.userIcons.toSkip.approved)
approvedQuery.descending("createdAt");
store.state.userIcons.toSkip += numToLoad;
store.state.userIcons.toSkip.approved += numToLoad;
let iconResults = await approvedQuery.find();

iconResults.forEach((result)=>{
Expand All @@ -273,12 +277,12 @@ export default new Vuex.Store({

notApprovedQuery.limit(numToLoad)
notApprovedQuery.equalTo("user", userObj);
notApprovedQuery.skip(store.state.userIcons.toSkip)
notApprovedQuery.skip(store.state.userIcons.toSkip.notApproved)
notApprovedQuery.descending("createdAt");
approvedQuery.exists("highResPngFile");
notApprovedQuery.equalTo("approved", false);
store.state.userIcons.toSkip.notApproved += numToLoad;
let notApproved = await notApprovedQuery.find();

console.log(notApproved);
notApproved.forEach((result)=>{
returnIconData(result, "notApproved");
})
Expand Down

1 comment on commit 6e31c9a

@vercel
Copy link

@vercel vercel bot commented on 6e31c9a May 24, 2021

Choose a reason for hiding this comment

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

Please sign in to comment.