From ebb9b5db40633083ea279e4800f9b6a8283fec2c Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Sat, 22 May 2021 01:12:18 -0400 Subject: [PATCH] Fix JS syntax bug --- src/Ema/Asset.hs | 9 +++------ src/Ema/Server.hs | 2 +- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/Ema/Asset.hs b/src/Ema/Asset.hs index 643501c..cd91e1b 100644 --- a/src/Ema/Asset.hs +++ b/src/Ema/Asset.hs @@ -3,14 +3,11 @@ module Ema.Asset where --- | The type of assets produced by Ema. +-- | The type of assets that can be bundled in a static site. data Asset a - = -- | A static file that is copied as-is from the source directory. + = -- | A file that is copied as-is from the source directory. AssetStatic FilePath - | -- | A file whose contents are generated by user code. - -- - -- If the the file is HTML, then use `Just Html` to inform Ema's live server - -- of its nature. + | -- | A file whose contents are generated at runtime by user code. AssetGenerated Format a deriving (Eq, Show, Ord, Generic) diff --git a/src/Ema/Server.hs b/src/Ema/Server.hs index 0acc0cc..b2e2eef 100644 --- a/src/Ema/Server.hs +++ b/src/Ema/Server.hs @@ -281,7 +281,7 @@ wsClientShim = ws.onmessage = evt => { console.log("ema: ✍ Patching DOM") - if evt.data.startsWith("REDIRECT ") { + if (evt.data.startsWith("REDIRECT ")) { document.location.href = evt.data.str.slice("REDIRECT ".length); } else { setHtml(document.documentElement, evt.data);