diff options
author | Joris | 2020-01-19 14:03:31 +0100 |
---|---|---|
committer | Joris | 2020-01-19 14:10:51 +0100 |
commit | af8353c6164aaaaa836bfed181f883ac86bb76a5 (patch) | |
tree | b23c3f87a82f0e3c2e5ed46b932c3495616cfbae /client/src/Main.hs | |
parent | bc48d7428607c84003658d5b88d41cf923d010fd (diff) |
Sign in with email and password
Diffstat (limited to 'client/src/Main.hs')
-rw-r--r-- | client/src/Main.hs | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/client/src/Main.hs b/client/src/Main.hs index d6f89cd..c71b0f0 100644 --- a/client/src/Main.hs +++ b/client/src/Main.hs @@ -14,7 +14,7 @@ import JSDOM.Types (HTMLElement (..), JSM, import qualified JSDOM.Types as Dom import Prelude hiding (error, init) -import Common.Model (InitResult (InitError)) +import Common.Model (Init) import qualified Common.Msg as Msg import qualified View.App as App @@ -24,7 +24,7 @@ main = do initResult <- readInit App.widget initResult -readInit :: JSM InitResult +readInit :: JSM (Maybe Init) readInit = do document <- Dom.currentDocumentUnchecked initNode <- Dom.getElementById document ("init" :: JSString) @@ -34,8 +34,6 @@ readInit = do text <- Dom.textFromJSString <$> Dom.getInnerText (Dom.uncheckedCastTo HTMLElement node) return $ case Aeson.decode (LB.fromStrict . T.encodeUtf8 $ text) of Just init -> init - Nothing -> initParseError + Nothing -> Nothing _ -> - return initParseError - - where initParseError = InitError $ Msg.get Msg.SignIn_ParseError + return Nothing |