diff --git a/index.html b/index.html index f924db06..7e05fb87 100644 --- a/index.html +++ b/index.html @@ -383,8 +383,8 @@ if (window.location.host.endsWith('8bitworkshop.com')) { Private
License: - Will decide later - CC Zero (public domain, recommended) + Will decide later / all rights reserved + CC Zero (public domain, remix-friendly) MIT (must preserve notices) CC BY (must attribute) CC BY-SA (must attribute, use same license) diff --git a/src/ui.ts b/src/ui.ts index 43f48a34..62a15003 100644 --- a/src/ui.ts +++ b/src/ui.ts @@ -1862,18 +1862,16 @@ function convertLegacyVCS(store) { const useHTTPSCookieName = "__use_https"; -function shouldRedirectHTTPS() { - // cookie set? - if (getCookie(useHTTPSCookieName)) { - return true; +function shouldRedirectHTTPS() : boolean { + // cookie set? either true or false + var shouldRedir = getCookie(useHTTPSCookieName); + if (typeof shouldRedir === 'string') { + return !!shouldRedir; // convert to bool } - // is this our first time here? if so, set a 10yr cookie - if (hasLocalStorage && !localStorage.getItem("__lastplatform")) { - document.cookie = useHTTPSCookieName + "=1;domain=8bitworkshop.com;path=/;max-age=315360000"; - return true; - } - // we can't redirect, might still have HTTP files - return false; + // set a 10yr cookie, value depends on if it's our first time here + var val = hasLocalStorage && !localStorage.getItem("__lastplatform") ? 1 : 0; + document.cookie = useHTTPSCookieName + "=" + val + ";domain=8bitworkshop.com;path=/;max-age=315360000"; + return !!val; } function redirectToHTTPS() {