Chatwoot/app/javascript/shared/mixins/campaignMixin.js

17 lines
425 B
JavaScript
Raw Normal View History

2021-07-15 08:01:43 +00:00
import { CAMPAIGN_TYPES } from '../constants/campaign';
export default {
computed: {
campaignType() {
const pageURL = window.location.href;
const type = pageURL.substr(pageURL.lastIndexOf('/') + 1);
return type;
2021-07-15 08:01:43 +00:00
},
isOngoingType() {
return this.campaignType === CAMPAIGN_TYPES.ONGOING;
},
isOnOffType() {
return this.campaignType === CAMPAIGN_TYPES.ONE_OFF;
},
},
};