Skip to content

Commit

Permalink
fixing ghcjs#64
Browse files Browse the repository at this point in the history
  • Loading branch information
athanclark committed Jul 31, 2021
1 parent 376df8e commit acd1aa0
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions jsaddle-warp/src/Language/Javascript/JSaddle/WebSockets.hs
Original file line number Diff line number Diff line change
Expand Up @@ -225,12 +225,13 @@ jsaddleJs' jsaddleUri refreshOnLoad = "\
\ }\n\
\\n\
\ " <> runBatch (\a -> "ws.send(JSON.stringify(" <> a <> "));")
(Just (\a -> "(function(){\n\
\ var xhr = new XMLHttpRequest();\n\
\ xhr.open('POST', '" <> fromMaybe "" jsaddleUri <> "/sync/'+syncKey, false);\n\
\ xhr.setRequestHeader(\"Content-type\", \"application/json\");\n\
\ xhr.send(JSON.stringify(" <> a <> "));\n\
\ return JSON.parse(xhr.response);})()")) <> "\
-- (Just (\a -> "(function(){\n\
-- \ var xhr = new XMLHttpRequest();\n\
-- \ xhr.open('POST', '" <> fromMaybe "" jsaddleUri <> "/sync/'+syncKey, false);\n\
-- \ xhr.setRequestHeader(\"Content-type\", \"application/json\");\n\
-- \ xhr.send(JSON.stringify(" <> a <> "));\n\
-- \ return JSON.parse(xhr.response);})()")) <> "\
Nothing <> "\
\ };\n\
\ };\n\
\ ws0.onerror = function() {\n\
Expand Down

0 comments on commit acd1aa0

Please sign in to comment.