Fix journal ordering fix (#28 again)
This commit is contained in:
parent
0709cabea1
commit
2bf54136ca
@ -50,19 +50,22 @@ const setBearer = async function () {
|
|||||||
}
|
}
|
||||||
/* eslint-enable no-console */
|
/* eslint-enable no-console */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the sort value for a prayer request
|
||||||
|
* @param x The prayer request
|
||||||
|
*/
|
||||||
|
const sortValue = x => x.showAfter === 0 ? x.asOf : x.showAfter
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sort journal requests either by asOf or showAfter
|
* Sort journal requests either by asOf or showAfter
|
||||||
*/
|
*/
|
||||||
const journalSort = function (a, b) {
|
const journalSort = (a, b) => sortValue(a) - sortValue(b)
|
||||||
const sortValue = x => x.showAfter === 0 ? x.asOf : x.showAfter
|
|
||||||
return sortValue(a) - sortValue(b)
|
|
||||||
}
|
|
||||||
|
|
||||||
export default new Vuex.Store({
|
export default new Vuex.Store({
|
||||||
state: {
|
state: {
|
||||||
user: auth.session.profile,
|
user: auth.session.profile,
|
||||||
isAuthenticated: auth.isAuthenticated(),
|
isAuthenticated: auth.isAuthenticated(),
|
||||||
journal: {},
|
journal: [],
|
||||||
isLoadingJournal: false
|
isLoadingJournal: false
|
||||||
},
|
},
|
||||||
mutations: {
|
mutations: {
|
||||||
@ -115,7 +118,7 @@ export default new Vuex.Store({
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
async [actions.LOAD_JOURNAL] ({ commit }, progress) {
|
async [actions.LOAD_JOURNAL] ({ commit }, progress) {
|
||||||
commit(mutations.LOADED_JOURNAL, {})
|
commit(mutations.LOADED_JOURNAL, [])
|
||||||
progress.$emit('show', 'query')
|
progress.$emit('show', 'query')
|
||||||
commit(mutations.LOADING_JOURNAL, true)
|
commit(mutations.LOADING_JOURNAL, true)
|
||||||
await setBearer()
|
await setBearer()
|
||||||
|
Loading…
Reference in New Issue
Block a user