File tree 1 file changed +5
-12
lines changed
app/javascript/widget/views 1 file changed +5
-12
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ import {
17
17
setCustomAttributes ,
18
18
} from ' widget/api/conversation' ;
19
19
import TeamAvailability from ' widget/components/TeamAvailability' ;
20
- import { mapGetters , mapActions } from ' vuex' ;
20
+ import { mapGetters } from ' vuex' ;
21
21
import routerMixin from ' widget/mixins/routerMixin' ;
22
22
export default {
23
23
name: ' Home' ,
@@ -46,19 +46,12 @@ export default {
46
46
}),
47
47
},
48
48
methods: {
49
- ... mapActions (' conversation' , [
50
- ' clearConversations' ,
51
- ]),
52
- async startConversation () {
49
+ startConversation () {
53
50
const ref = new URLSearchParams (window .location .search ).get (' referral' );
54
51
if (ref) {
55
- try {
56
- await setCustomAttributes ({" ref" : ref});
57
- this .clearConversations ();
58
- } catch (e) {
59
- // Ignore error
60
- }
61
- } else if (this .preChatFormEnabled && ! this .conversationSize ) {
52
+ this .$store .dispatch (' conversation/createConversation' , {});
53
+ }
54
+ if (this .preChatFormEnabled && ! this .conversationSize ) {
62
55
return this .replaceRoute (' prechat-form' );
63
56
}
64
57
return this .replaceRoute (' messages' );
You can’t perform that action at this time.
0 commit comments