Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
idCounter = idGenerator(
typeof __idCounterCurrent !== undefined
? __idCounterCurrent
: getMaxId(storedDraft),
);
} catch (error) {
defaultFromDraft = null;
}
const defaultState = defaultFromDraft || defaultForm;
this.setState({
// eslint-disable-line react/no-did-mount-set-state
...defaultState,
});
ReactPixel.track('InitiateCheckout', {
content_category: PIXEL_CONTENT_CATEGORY.VISIT_INTERVIEW_FORM,
});
}
componentDidUpdate(prevProps) {
this.props.queryMenuIfUnfetched();
this.props.queryEntryIfUnfetched(idSelector(this.props));
// send Facebook Pixel 'ViewContent' event if goto reading another labor rights unit
if (idSelector(prevProps) !== idSelector(this.props)) {
ReactPixel.track('ViewContent', {
content_ids: [idSelector(this.props)],
content_category: PIXEL_CONTENT_CATEGORY.VIEW_LABOR_RIGHT,
});
}
}
componentDidMount() {
this.props.queryMenuIfUnfetched();
this.props.queryEntryIfUnfetched(idSelector(this.props));
this.props.fetchPermission();
// send Facebook Pixel 'ViewContent' event
ReactPixel.track('ViewContent', {
content_ids: [this.props.match.params.id],
content_category: PIXEL_CONTENT_CATEGORY.VIEW_LABOR_RIGHT,
});
}
componentDidMount() {
const defaultState =
getDefaultFormFromLocation(this.props.location) ||
getDefaultFormFromDraft() ||
defaultForm;
this.setState({
// eslint-disable-line react/no-did-mount-set-state
...defaultState,
});
ReactPixel.track('InitiateCheckout', {
content_category: PIXEL_CONTENT_CATEGORY.VISIT_TIME_AND_SALARY_FORM,
});
}
response => {
const count = response.queries_count;
ReactGA.event({
category: GA_CATEGORY.SHARE_TIME_SALARY,
action: GA_ACTION.UPLOAD_SUCCESS,
});
ReactPixel.track('Purchase', {
value: 1,
currency: 'TWD',
content_category: PIXEL_CONTENT_CATEGORY.UPLOAD_TIME_AND_SALARY,
});
return () => (
{
window.location.replace(
`/time-and-salary/campaigns/${campaignName}/latest`,
);
}}
/>
response => {
const count = response.queries_count;
ReactGA.event({
category: GA_CATEGORY.SHARE_TIME_SALARY,
action: GA_ACTION.UPLOAD_SUCCESS,
});
ReactPixel.track('Purchase', {
value: 1,
currency: 'TWD',
content_category: PIXEL_CONTENT_CATEGORY.UPLOAD_TIME_AND_SALARY,
});
return () => (
{
window.location.replace('/salary-work-times/latest');
}}
/>
);
},
componentDidMount() {
if (this.props.campaignEntriesStatus === fetchingStatus.FETCHED) {
this.setCampaignInfoFromEntries(this.props.campaignEntries);
} else {
this.props.queryCampaignInfoListIfNeeded();
}
ReactPixel.track('InitiateCheckout', {
content_category: PIXEL_CONTENT_CATEGORY.VISIT_TIME_AND_SALARY_FORM,
});
}
response => {
const experienceId = response.experience._id;
ReactGA.event({
category: GA_CATEGORY.SHARE_INTERVIEW,
action: GA_ACTION.UPLOAD_SUCCESS,
});
ReactPixel.track('Purchase', {
value: 1,
currency: 'TWD',
content_category:
PIXEL_CONTENT_CATEGORY.UPLOAD_INTERVIEW_EXPERIENCE,
});
return () => (
window.location.replace(`/experiences/${experienceId}`)
}
/>
);
},
error => {
searchText => {
history.push(`/search?q=${encodeURIComponent(searchText)}`);
ReactPixel.track('Search', {
search_string: searchText,
content_category: PIXEL_CONTENT_CATEGORY.SEARCH_TIME_AND_SALARY,
});
},
[history],
response => {
const experienceId = response.experience._id;
ReactGA.event({
category: GA_CATEGORY.SHARE_INTERVIEW,
action: GA_ACTION.UPLOAD_SUCCESS,
});
ReactPixel.track('Purchase', {
value: 1,
currency: 'TWD',
content_category:
PIXEL_CONTENT_CATEGORY.UPLOAD_INTERVIEW_EXPERIENCE,
});
return () => (
window.location.replace(`/experiences/${experienceId}`)
}
/>
);
},
error => {