mirror of
https://github.com/getbible/app.git
synced 2024-12-22 07:48:55 +00:00
Adding actions and mutations to mutate the selected chapter, book as well as translations state properties
This commit is contained in:
parent
5a4a3e9832
commit
17a111d2dd
@ -90,7 +90,7 @@ export default {
|
|||||||
commit('set_book', payload)
|
commit('set_book', payload)
|
||||||
},
|
},
|
||||||
async set_translation({commit}, payload){
|
async set_translation({commit}, payload){
|
||||||
let translation = await idb.get('translations', payload.selectedTranslation).catch(err => console.log(err));
|
let translation = await idb.get('translations', payload.selected_translation).catch(err => console.log(err));
|
||||||
|
|
||||||
if(!translation) return;
|
if(!translation) return;
|
||||||
payload.translation = translation
|
payload.translation = translation
|
||||||
|
@ -59,10 +59,13 @@ export default {
|
|||||||
state.selected.chapter = payload;
|
state.selected.chapter = payload;
|
||||||
},
|
},
|
||||||
set_book(state, payload){
|
set_book(state, payload){
|
||||||
|
state.selected.chapter = null;
|
||||||
state.selected.book = payload;
|
state.selected.book = payload;
|
||||||
},
|
},
|
||||||
set_translation(state, payload){
|
set_translation(state, payload){
|
||||||
state.selected.translation = payload.selectedTranslation;
|
state.selected.book = null
|
||||||
|
state.selected.chapter = null
|
||||||
|
state.selected.translation = payload.selected_translation;
|
||||||
state.in_memory_translation = payload.translation;
|
state.in_memory_translation = payload.translation;
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user