Skip to content

Commit

Permalink
RollBack referrall new conversation fixes (#132)
Browse files Browse the repository at this point in the history
  • Loading branch information
cmm-apli authored Mar 22, 2024
1 parent 3a9cfc3 commit 6b47679
Showing 1 changed file with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions app/javascript/widget/views/Home.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {
setCustomAttributes,
} from 'widget/api/conversation';
import TeamAvailability from 'widget/components/TeamAvailability';
import { mapGetters, mapActions } from 'vuex';
import { mapGetters } from 'vuex';
import routerMixin from 'widget/mixins/routerMixin';
export default {
name: 'Home',
Expand Down Expand Up @@ -46,19 +46,12 @@ export default {
}),
},
methods: {
...mapActions('conversation', [
'clearConversations',
]),
async startConversation() {
startConversation() {
const ref = new URLSearchParams(window.location.search).get('referral');
if (ref) {
try {
await setCustomAttributes({"ref": ref});
this.clearConversations();
} catch (e) {
// Ignore error
}
} else if (this.preChatFormEnabled && !this.conversationSize) {
this.$store.dispatch('conversation/createConversation', {});
}
if (this.preChatFormEnabled && !this.conversationSize) {
return this.replaceRoute('prechat-form');
}
return this.replaceRoute('messages');
Expand Down

0 comments on commit 6b47679

Please sign in to comment.