1
1
mirror of https://github.com/srid/ema.git synced 2024-12-02 09:15:10 +03:00

Fix JS syntax bug

This commit is contained in:
Sridhar Ratnakumar 2021-05-22 01:12:18 -04:00
parent bf929dec72
commit ebb9b5db40
2 changed files with 4 additions and 7 deletions

View File

@ -3,14 +3,11 @@
module Ema.Asset where 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 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 AssetStatic FilePath
| -- | A file whose contents are generated by user code. | -- | A file whose contents are generated at runtime by user code.
--
-- If the the file is HTML, then use `Just Html` to inform Ema's live server
-- of its nature.
AssetGenerated Format a AssetGenerated Format a
deriving (Eq, Show, Ord, Generic) deriving (Eq, Show, Ord, Generic)

View File

@ -281,7 +281,7 @@ wsClientShim =
ws.onmessage = evt => { ws.onmessage = evt => {
console.log("ema: ✍ Patching DOM") console.log("ema: ✍ Patching DOM")
if evt.data.startsWith("REDIRECT ") { if (evt.data.startsWith("REDIRECT ")) {
document.location.href = evt.data.str.slice("REDIRECT ".length); document.location.href = evt.data.str.slice("REDIRECT ".length);
} else { } else {
setHtml(document.documentElement, evt.data); setHtml(document.documentElement, evt.data);