Skip to content

Commit

Permalink
Don't send /livereload requests in prod
Browse files Browse the repository at this point in the history
  • Loading branch information
tchoutri committed Nov 3, 2024
1 parent 2ade7cb commit 4d10b5e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/web/FloraWeb/Components/Header.hs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import FloraWeb.Pages.Templates.Types (FloraHTML, TemplateEnv (..))

header :: FloraHTML
header = do
TemplateEnv{title, indexPage} <- ask
TemplateEnv{environment, title, indexPage} <- ask
doctype_
html_
[ lang_ "en"
Expand Down Expand Up @@ -69,7 +69,10 @@ header = do
meta_ [name_ "twitter:dnt", content_ "on"]

body_ [] $ do
div_ [hxGet_ "/livereload", hxTrigger_ "every 2s"] mempty
case environment of
Development ->
div_ [hxGet_ "/livereload", hxTrigger_ "every 2s"] mempty
_ -> mempty
navbar

jsLink :: FloraHTML
Expand Down

0 comments on commit 4d10b5e

Please sign in to comment.