4
2
mirror of https://github.com/getbible/app.git synced 2024-12-22 07:48:55 +00:00

added and debugged search mutation & action

This commit is contained in:
Erastus Amunwe 2020-12-04 13:36:30 +02:00
parent 466f9a8489
commit a2ee1d4d5e
2 changed files with 18 additions and 8 deletions

View File

@ -77,7 +77,7 @@ export default {
async initialise({commit}){
commit('toggle_loading', true)
let saved_translations = await idb.getAll('saved_translations').catch(err => console.log(err));
console.log(saved_translations);
if(!saved_translations) saved_translations = [];
@ -93,6 +93,9 @@ export default {
set_chapter({commit}, payload) {
commit('set_chapter', payload)
},
message({commit}, payload){
commit('message', payload)
},
set_book({commit}, payload) {
commit('set_book', payload)
},
@ -107,5 +110,8 @@ export default {
setTimeout(()=>{
commit('toggle_loading', false)
}, 2500)
},
search({commit}, payload){
commit('search', payload)
}
}

View File

@ -46,16 +46,17 @@ export default {
}
},
// save_settings(state, settings){
// state.settings = settings;
// localStorage.setItem('settings', JSON.stringify(settings))
// },
// add_search(state, search){
// state.search = search
// }
save_settings(state, settings){
state.settings = settings;
localStorage.setItem('settings', JSON.stringify(settings))
},
add_search(state, search){
state.search = search
},
initialise(state, payload){
state.saved_translations = payload.saved_translations
state.in_memory_translation = payload.translation
console.log(state.saved_translations);
},
set_chapter(state, payload){
state.selected.chapter = payload;
@ -72,5 +73,8 @@ export default {
},
toggle_loading(state, payload){
state.loading = payload;
},
search(state, payload){
state.search = payload;
}
}