Skip to content

Commit

Permalink
campaignTypeObj fix
Browse files Browse the repository at this point in the history
  • Loading branch information
PraveenCTzen committed Nov 5, 2024
1 parent 4d7493f commit 7770b52
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 25 deletions.
28 changes: 15 additions & 13 deletions clevertap.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion clevertap.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion clevertap.min.js

Large diffs are not rendered by default.

21 changes: 11 additions & 10 deletions src/util/tr.js
Original file line number Diff line number Diff line change
Expand Up @@ -218,17 +218,18 @@ const _tr = (msg, {
let campaignObj = getCampaignObject()
const campaignTypeObj = campaignObj.wp
let todaysCount, sessionCount

if (campaignTypeObj[today]) {
todaysCount = campaignTypeObj[today]?.tc
if (todaysCount > 0) {
console.log('transfer count to new structure')
if (campaignTypeObj) {
if (campaignTypeObj[today]) {
todaysCount = campaignTypeObj[today]?.tc
if (todaysCount > 0) {
console.log('transfer count to new structure')
}
}
}
if (campaignTypeObj[_session.sessionId]) {
sessionCount = campaignTypeObj[_session.sessionId]?.tc
if (sessionCount > 0) {
campaignObj.wp.global.wp_sc = { [_session.sessionId]: sessionCount }
if (campaignTypeObj[_session.sessionId]) {
sessionCount = campaignTypeObj[_session.sessionId]?.tc
if (sessionCount > 0) {
campaignObj.wp.global.wp_sc = { [_session.sessionId]: sessionCount }
}
}
}

Expand Down

0 comments on commit 7770b52

Please sign in to comment.