@@ -47,7 +47,11 @@ export const willShowPrivacyMessage = new Promise<boolean>((resolve) => {
47
47
const getPropertyHref = (
48
48
framework : ConsentFramework ,
49
49
useNonAdvertisedList : boolean ,
50
+ isInSourcepointGeolocationTest : boolean ,
50
51
) : Property => {
52
+ if ( isInSourcepointGeolocationTest ) {
53
+ return getPropertyHrefForGeolocationTest ( framework , useNonAdvertisedList ) ;
54
+ }
51
55
if ( framework == 'aus' ) {
52
56
return 'https://au.theguardian.com' ;
53
57
}
@@ -59,36 +63,41 @@ const getPropertyHref = (
59
63
return useNonAdvertisedList ? PROPERTY_HREF_SUBDOMAIN : PROPERTY_HREF_MAIN ;
60
64
} ;
61
65
62
- const getPropertyHrefForGeolocationTest = (
66
+ const getPropertyId = (
63
67
framework : ConsentFramework ,
64
68
useNonAdvertisedList : boolean ,
65
- ) : Property => {
69
+ isInSourcepointGeolocationTest : boolean ,
70
+ ) : number => {
71
+ if ( isInSourcepointGeolocationTest ) {
72
+ return getPropertyIdForGeolocationTest ( framework , useNonAdvertisedList ) ;
73
+ }
74
+
66
75
if ( framework == 'aus' ) {
67
- return 'https://au.theguardian.com' ;
76
+ return PROPERTY_ID_AUSTRALIA ;
68
77
}
69
78
70
79
if ( framework == 'usnat' ) {
71
- return PROPERTY_HREF_MAIN_TEST ;
80
+ return PROPERTY_ID_MAIN ;
72
81
}
73
82
74
- return useNonAdvertisedList
75
- ? PROPERTY_HREF_SUBDOMAIN
76
- : PROPERTY_HREF_MAIN_TEST ;
83
+ return useNonAdvertisedList ? PROPERTY_ID_SUBDOMAIN : PROPERTY_ID_MAIN ;
77
84
} ;
78
85
79
- const getPropertyId = (
86
+ const getPropertyHrefForGeolocationTest = (
80
87
framework : ConsentFramework ,
81
88
useNonAdvertisedList : boolean ,
82
- ) : number => {
89
+ ) : Property => {
83
90
if ( framework == 'aus' ) {
84
- return PROPERTY_ID_AUSTRALIA ;
91
+ return 'https://au.theguardian.com' ;
85
92
}
86
93
87
94
if ( framework == 'usnat' ) {
88
- return PROPERTY_ID_MAIN ;
95
+ return PROPERTY_HREF_MAIN_TEST ;
89
96
}
90
97
91
- return useNonAdvertisedList ? PROPERTY_ID_SUBDOMAIN : PROPERTY_ID_MAIN ;
98
+ return useNonAdvertisedList
99
+ ? PROPERTY_HREF_SUBDOMAIN
100
+ : PROPERTY_HREF_MAIN_TEST ;
92
101
} ;
93
102
94
103
const getPropertyIdForGeolocationTest = (
@@ -204,12 +213,16 @@ export const init = (
204
213
config : {
205
214
baseEndpoint : ENDPOINT ,
206
215
accountId : ACCOUNT_ID ,
207
- propertyId : isInSourcepointGeolocationTest
208
- ? getPropertyIdForGeolocationTest ( framework , useNonAdvertisedList )
209
- : getPropertyId ( framework , useNonAdvertisedList ) ,
210
- propertyHref : isInSourcepointGeolocationTest
211
- ? getPropertyHrefForGeolocationTest ( framework , useNonAdvertisedList )
212
- : getPropertyHref ( framework , useNonAdvertisedList ) ,
216
+ propertyId : getPropertyId (
217
+ framework ,
218
+ useNonAdvertisedList ,
219
+ isInSourcepointGeolocationTest ,
220
+ ) ,
221
+ propertyHref : getPropertyHref (
222
+ framework ,
223
+ useNonAdvertisedList ,
224
+ isInSourcepointGeolocationTest ,
225
+ ) ,
213
226
joinHref : true ,
214
227
isSPA : true ,
215
228
targetingParams : {
0 commit comments