diff --git a/.version b/.version index b5e0f5f7a..f38c8c40c 100644 --- a/.version +++ b/.version @@ -1 +1 @@ -0.2.753 \ No newline at end of file +0.2.754 \ No newline at end of file diff --git a/cmd/templ/generatecmd/proxy/script.js b/cmd/templ/generatecmd/proxy/script.js index 29892777a..8e5579155 100644 --- a/cmd/templ/generatecmd/proxy/script.js +++ b/cmd/templ/generatecmd/proxy/script.js @@ -1,4 +1,4 @@ -(function () { +(function() { let templ_reloadSrc = window.templ_reloadSrc || new EventSource("/_templ/reload/events"); templ_reloadSrc.onmessage = (event) => { if (event && event.data === "reload") { @@ -6,4 +6,5 @@ } }; window.templ_reloadSrc = templ_reloadSrc; + window.onbeforeunload = () => window.templ_reloadSrc.close(); })();