mirror of
https://github.com/GuerillaStudio/souvenir.git
synced 2025-01-20 21:50:22 +00:00
fix(capture): Show welcome on camera denied access
This commit is contained in:
parent
5ff7b47fde
commit
446cded7e4
1 changed files with 7 additions and 4 deletions
11
src/store.js
11
src/store.js
|
@ -30,8 +30,8 @@ export default new Vuex.Store({
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mutations: {
|
mutations: {
|
||||||
welcome (state) {
|
updateWelcomed (state, welcome) {
|
||||||
state.welcomed = true;
|
state.welcomed = welcome;
|
||||||
},
|
},
|
||||||
startCamera (state, mediaStream) {
|
startCamera (state, mediaStream) {
|
||||||
state.mediaStream = mediaStream
|
state.mediaStream = mediaStream
|
||||||
|
@ -79,7 +79,7 @@ export default new Vuex.Store({
|
||||||
},
|
},
|
||||||
actions: {
|
actions: {
|
||||||
welcome ({ commit, dispatch }) {
|
welcome ({ commit, dispatch }) {
|
||||||
commit('welcome')
|
commit('updateWelcomed', true)
|
||||||
dispatch('requestCamera', false)
|
dispatch('requestCamera', false)
|
||||||
},
|
},
|
||||||
requestCamera ({ state, commit }, inverseFacingMode) {
|
requestCamera ({ state, commit }, inverseFacingMode) {
|
||||||
|
@ -104,7 +104,10 @@ export default new Vuex.Store({
|
||||||
commit('inverseFacingMode')
|
commit('inverseFacingMode')
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch(error => console.error(error))
|
.catch(error => {
|
||||||
|
console.error(error)
|
||||||
|
commit('updateWelcomed', false)
|
||||||
|
})
|
||||||
},
|
},
|
||||||
capture ({ commit, dispatch, state }) {
|
capture ({ commit, dispatch, state }) {
|
||||||
commit('startCapture')
|
commit('startCapture')
|
||||||
|
|
Loading…
Reference in a new issue