Skip to content

Commit d79438c

Browse files
committed
tweak retry logic
1 parent 70c7078 commit d79438c

1 file changed

Lines changed: 12 additions & 8 deletions

File tree

functions/utilities/privacy/utils.js

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ const getPrivacyState = (email, user) => {
107107

108108
const shouldRetry = shouldRetryPopup(latestTouch, useUnder13);
109109

110-
if (firstSeen && dueBy && !shouldRetry) {
110+
if (firstSeen && dueBy) {
111111
// User has seen popup before
112112

113113
if (Date.now() > dueBy) {
@@ -120,16 +120,20 @@ const getPrivacyState = (email, user) => {
120120
};
121121
}
122122

123-
// User has seen popup before but within 7 days
124-
return {
125-
debug: 4,
126-
visible: false,
127-
mode: "none",
128-
variant
129-
};
123+
if (!shouldRetry) {
124+
// User has seen popup before but within 7 days
125+
// and not time to retry yet
126+
return {
127+
debug: 4,
128+
visible: false,
129+
mode: "none",
130+
variant
131+
};
132+
}
130133
}
131134

132135
// User has not seen popup before
136+
// or it's time to retry
133137
return {
134138
debug: 5,
135139
visible: true,

0 commit comments

Comments
 (0)