Skip to content

Commit

Permalink
fix(fetchPosts): fix concat mode
Browse files Browse the repository at this point in the history
  • Loading branch information
AlejandroAkbal committed Jul 12, 2020
1 parent a212a49 commit 267b88c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion components/pages/dashboard/navigation/page/Controls.vue
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ export default {
console.debug('Loading more posts')
this.pidManager({ operation: 'add' })
this.fetchPosts({ mode: 'concat' })
this.fetchPosts('concat')
}, 5000),
},
}
Expand Down
9 changes: 6 additions & 3 deletions store/booru/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export const actions = {
commit('setActiveBooru', booruIndex)
},

postsManager({ commit }, { operation, value }) {
postsManager({ state, commit }, { operation, value }) {
switch (operation) {
case 'set':
commit('setPostsData', value)
Expand Down Expand Up @@ -245,8 +245,11 @@ export const actions = {
{ root: true }
)

if (mode === 'concat') commit('concatPostsData', response)
else commit('setPostsData', response)
if (mode === 'concat') {
dispatch('postsManager', { operation: 'concat', value: response })
} else {
dispatch('postsManager', { operation: 'set', value: response })
}
},

async fetchSearchTag({ dispatch, commit }, tag) {
Expand Down

0 comments on commit 267b88c

Please sign in to comment.