fix cwookies type shit

This commit is contained in:
illusionTBA 2024-08-25 00:46:05 -04:00
parent 8666196db3
commit e057519e83

View file

@ -17,11 +17,13 @@ export default function (client: ScramjetClient, self: typeof window) {
set(ctx, value: string) {
client.cookieStore.setCookies([value], client.url);
client.serviceWorker.controller!.postMessage({
scramjet$type: "cookie",
cookie: value,
url: client.url.href,
});
if (client.serviceWorker.controller) {
client.serviceWorker.controller!.postMessage({
scramjet$type: "cookie",
cookie: value,
url: client.url.href,
});
}
},
});