Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove CPP related to an iOS build. #672

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 8 additions & 15 deletions examples/mario/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,9 @@ import Data.Monoid
import Miso
import Miso.String

#ifdef IOS
import Language.Javascript.JSaddle.WKWebView as JSaddle

runApp :: JSM () -> IO ()
runApp = JSaddle.run
#else
import qualified Language.Javascript.JSaddle.Warp as JSaddle
#ifdef ghcjs_HOST_OS

#ifdef __GHCJS__
runApp :: JSM () -> IO ()
runApp = JSaddle.run 8080

Expand All @@ -31,14 +26,12 @@ import qualified Network.Wai.Handler.Warp as Warp
import Network.WebSockets

runApp :: JSM () -> IO ()
runApp f =
Warp.runSettings (Warp.setPort 8080 (Warp.setTimeout 3600 Warp.defaultSettings)) =<<
JSaddle.jsaddleOr defaultConnectionOptions (f >> syncPoint) app
where app req sendResp =
case Wai.pathInfo req of
("imgs" : _) -> staticApp (defaultWebAppSettings "examples/mario") req sendResp
_ -> JSaddle.jsaddleApp req sendResp
#endif
runApp f = JSaddle.debugOr defaultConnectionOptions app (f >> syncPoint)
where
app req sendResp =
case Wai.pathInfo req of
("imgs" : _) -> staticApp (defaultWebAppSettings "examples/mario") req sendResp
_ -> JSaddle.jsaddleApp req sendResp
#endif

data Action
Expand Down
Loading