I didn't know how replace worked fuck

This commit is contained in:
Pagwin 2025-01-03 22:53:56 -05:00
parent f9df398c65
commit 6423d4478d
No known key found for this signature in database
GPG key ID: 81137023740CA260

View file

@ -19,10 +19,10 @@ async function fetchResponse(event) {
theme_toggled = value[0] === "t"; theme_toggled = value[0] === "t";
} }
// this is a somewhat brittle way of accomplishing our desired behavior // this is a somewhat brittle way of accomplishing our desired behavior
body.replace(`<html lang="en">`, const new_body = body.replace(`<html lang="en">`,
`<html lang="en" toggletheme="${theme_toggled}">`); `<html lang="en" toggletheme="${theme_toggled}">`);
console.log(body); console.log(new_body);
return new Response(body, resp); return new Response(new_body, resp);
} }
// needed if we actually want to get requests // needed if we actually want to get requests