Skip to content

Commit

Permalink
more consistent
Browse files Browse the repository at this point in the history
  • Loading branch information
tamw-wnet committed Sep 30, 2024
1 parent afc5ce1 commit 4c4e3f8
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions assets/js/jquery.pids.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,6 @@ jQuery(document).ready(function($) {

var correct_mvhash = '';
var userinfolink_base = userinfolink; // saving a backup of the original for a later issue
if (typeof Cookies.get('pbsoauth_mvhash') !== "undefined") {
correct_mvhash = Cookies.get('pbsoauth_mvhash');
userinfolink = userinfolink + "?mvhash=" + correct_mvhash;
}

function loginToPBS(event) {
event.preventDefault();
Expand Down Expand Up @@ -155,10 +151,17 @@ jQuery(document).ready(function($) {
}
// set the global object value
userPBSLoginStatus = currentarray;

// update the userinfo link with cachebusting
if (typeof Cookies.get('pbsoauth_mvhash') !== "undefined") {
correct_mvhash = Cookies.get('pbsoauth_mvhash'); userinfolink = userinfolink + "?mvhash=" + correct_mvhash;
}

// push a dataLayer event to GTM
window.dataLayer = window.dataLayer || [];
dataLayer.push({ 'event': 'passport_login_status', 'memberstatus': currentarray.memberStatus });
console.log(dataLayer);

// and done
return currentarray;
}
Expand Down

0 comments on commit 4c4e3f8

Please sign in to comment.