File tree Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -72,17 +72,23 @@ export function startObservingColorSchemeHtmlAttribute() {
7272
7373 {
7474 const setColorSchemeCookie = ( colorScheme : ColorScheme ) => {
75+ console . log ( "DEBUG: setColorSchemeCookie" ) ;
76+
7577 let newCookie = `${ data_fr_theme } =${ colorScheme } ;path=/;max-age=31536000` ;
7678
7779 //We do not set the domain if we are on localhost or an ip
7880 if ( window . location . hostname . match ( / \. [ a - z A - Z ] { 2 , } $ / ) ) {
81+ console . log ( "DEBUG: Append to newCookie" ) ;
82+
7983 newCookie += `;domain=${
8084 window . location . hostname . split ( "." ) . length >= 3
8185 ? window . location . hostname . replace ( / ^ [ ^ . ] + \. / , "" )
8286 : window . location . hostname
8387 } `;
8488 }
8589
90+ console . log ( `DEBUG: set newCookie: ${ newCookie } ` ) ;
91+
8692 document . cookie = newCookie ;
8793 } ;
8894
Original file line number Diff line number Diff line change @@ -67,6 +67,8 @@ export async function startDsfrReact(params: Params) {
6767 ) ;
6868 }
6969
70+ console . log ( "DEBUG: startObservingColorSchemeHtmlAttribute" ) ;
71+
7072 startObservingColorSchemeHtmlAttribute ( ) ;
7173
7274 ( window as any ) . dsfr = { verbose, "mode" : "manual" } ;
You can’t perform that action at this time.
0 commit comments