feat: End conversation from widget (#3660)

Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
Co-authored-by: Fayaz Ahmed <15716057+fayazara@users.noreply.github.com>
Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
Co-authored-by: Nithin David Thomas <1277421+nithindavid@users.noreply.github.com>
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
This commit is contained in:
Aswin Dev P.S
2022-03-15 22:07:30 +05:30
committed by GitHub
parent 4b748e2c8c
commit c4837cd7ac
19 changed files with 263 additions and 18 deletions

View File

@@ -100,6 +100,7 @@ export const actions = {
{ root: true }
);
await triggerCampaign({ campaignId, websiteToken });
commit('setCampaignExecuted', true);
commit('setActiveCampaign', {});
} catch (error) {
commit('setError', true);
@@ -113,6 +114,7 @@ export const actions = {
},
resetCampaign: async ({ commit }) => {
try {
commit('setCampaignExecuted', false);
commit('setActiveCampaign', {});
} catch (error) {
commit('setError', true);
@@ -130,6 +132,12 @@ export const mutations = {
setError($state, value) {
Vue.set($state.uiFlags, 'isError', value);
},
setHasFetched($state, value) {
Vue.set($state.uiFlags, 'hasFetched', value);
},
setCampaignExecuted($state, data) {
Vue.set($state, 'campaignHasExecuted', data);
},
};
export default {