feat: Create campaign conversation only if user interacts with the bubble (#2335)
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
This commit is contained in:
parent
853db60f8e
commit
fb2f3ff89f
14 changed files with 211 additions and 18 deletions
|
@ -1,5 +1,4 @@
|
|||
import { triggerCampaign } from 'widget/api/campaign';
|
||||
|
||||
import store from '../store';
|
||||
class CampaignTimer {
|
||||
constructor() {
|
||||
this.campaignTimers = [];
|
||||
|
@ -10,7 +9,7 @@ class CampaignTimer {
|
|||
campaigns.forEach(campaign => {
|
||||
const { timeOnPage, id: campaignId } = campaign;
|
||||
this.campaignTimers[campaignId] = setTimeout(() => {
|
||||
triggerCampaign({ campaignId });
|
||||
store.dispatch('campaign/startCampaign', { campaignId });
|
||||
}, timeOnPage * 1000);
|
||||
});
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue