Skip to content

Commit

Permalink
fix: do not rewrite when a required field has null value
Browse files Browse the repository at this point in the history
  • Loading branch information
mohammadh committed Feb 7, 2023
1 parent 8cad623 commit 8f9e652
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion public/scripts/cookie.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ const shouldOverwrite = (new_utm_data, current_utm_data) => {
// If we have old utm data, 3 fields are required for new utm data to rewrite the old one
const required_fields = ["utm_source", "utm_medium", "utm_campaign"];
const has_new_required_fields = required_fields.every(
(field) => new_utm_data[field]
(field) => new_utm_data[field] !== "null"
);
if (has_new_required_fields) {
return true;
Expand Down

0 comments on commit 8f9e652

Please sign in to comment.