File tree Expand file tree Collapse file tree 1 file changed +17
-2
lines changed
functions/utilities/privacy Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -59,7 +59,19 @@ const getPrivacyVariant = (user) => {
5959 } catch {
6060 return null ;
6161 }
62- }
62+ }
63+
64+ const shouldRetryPopup = ( lastTouched , isUnder13 ) => {
65+ if ( isUnder13 ) return false ;
66+
67+ try {
68+ if ( ! lastTouched ) return false ;
69+ const threeHoursAgo = Date . now ( ) - ( 3 * 60 * 60 * 1000 ) ;
70+ return lastTouched < threeHoursAgo ;
71+ } catch {
72+ return false ;
73+ }
74+ }
6375
6476const getPrivacyState = ( email , user ) => {
6577 const isUnder13 = isUnderThirteen ( user ) ;
@@ -91,8 +103,11 @@ const getPrivacyState = (email, user) => {
91103
92104 const firstSeen = user [ firstSeenKey ] ;
93105 const dueBy = user [ dueByKey ] ;
106+ const latestTouch = user [ latestTouchKey ] ;
107+
108+ const shouldRetry = shouldRetryPopup ( latestTouch , useUnder13 ) ;
94109
95- if ( firstSeen && dueBy ) {
110+ if ( firstSeen && dueBy && ! shouldRetry ) {
96111 // User has seen popup before
97112
98113 if ( Date . now ( ) > dueBy ) {
You can’t perform that action at this time.
0 commit comments