From 446cded7e4367daf484f55401601f9211399136d Mon Sep 17 00:00:00 2001 From: wryk Date: Wed, 13 Mar 2019 14:50:46 +0100 Subject: [PATCH] fix(capture): Show welcome on camera denied access --- src/store.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/store.js b/src/store.js index 532051d..05e2547 100644 --- a/src/store.js +++ b/src/store.js @@ -30,8 +30,8 @@ export default new Vuex.Store({ } }, mutations: { - welcome (state) { - state.welcomed = true; + updateWelcomed (state, welcome) { + state.welcomed = welcome; }, startCamera (state, mediaStream) { state.mediaStream = mediaStream @@ -79,7 +79,7 @@ export default new Vuex.Store({ }, actions: { welcome ({ commit, dispatch }) { - commit('welcome') + commit('updateWelcomed', true) dispatch('requestCamera', false) }, requestCamera ({ state, commit }, inverseFacingMode) { @@ -104,7 +104,10 @@ export default new Vuex.Store({ commit('inverseFacingMode') } }) - .catch(error => console.error(error)) + .catch(error => { + console.error(error) + commit('updateWelcomed', false) + }) }, capture ({ commit, dispatch, state }) { commit('startCapture')