reverting tinkering
This commit is contained in:
parent
cd58dfde69
commit
98767bb01c
2 changed files with 14 additions and 32 deletions
|
@ -69,20 +69,20 @@ renderLayout widget = do
|
||||||
route <- getCurrentRoute
|
route <- getCurrentRoute
|
||||||
mmsg <- getMessage
|
mmsg <- getMessage
|
||||||
msu <- lookupSession "userId"
|
msu <- lookupSession "userId"
|
||||||
-- username <- case msu of
|
username <- case msu of
|
||||||
-- Just a -> do
|
Just a -> do
|
||||||
-- let uId = getUserIdFromText a
|
let uId = getUserIdFromText a
|
||||||
-- user <- runDB $ getJust uId
|
user <- runDB $ getJust uId
|
||||||
-- return $ userName user
|
return $ userName user
|
||||||
-- Nothing ->
|
Nothing ->
|
||||||
-- return ("" :: T.Text)
|
return ("" :: T.Text)
|
||||||
-- slug <- case msu of
|
slug <- case msu of
|
||||||
-- Just a -> do
|
Just a -> do
|
||||||
-- let uId = getUserIdFromText a
|
let uId = getUserIdFromText a
|
||||||
-- user <- runDB $ getJust uId
|
user <- runDB $ getJust uId
|
||||||
-- return $ userSlug user
|
return $ userSlug user
|
||||||
-- Nothing ->
|
Nothing ->
|
||||||
-- return ("" :: T.Text)
|
return ("" :: T.Text)
|
||||||
let block = appSignupBlocked $ appSettings master
|
let block = appSignupBlocked $ appSettings master
|
||||||
|
|
||||||
-- We break up the default layout into two components:
|
-- We break up the default layout into two components:
|
||||||
|
|
18
Helper.hs
18
Helper.hs
|
@ -41,24 +41,6 @@ import Network.HTTP.Client
|
||||||
import Network.HTTP.Types.Status as S
|
import Network.HTTP.Types.Status as S
|
||||||
import Control.Monad (when)
|
import Control.Monad (when)
|
||||||
|
|
||||||
getUsername :: Maybe T.Text -> Handler (Maybe T.Text)
|
|
||||||
getUsername mtid =
|
|
||||||
getSkel mtid userName
|
|
||||||
|
|
||||||
getSlug :: Maybe T.Text -> Handler (Maybe T.Text)
|
|
||||||
getSlug mtid =
|
|
||||||
getSkel mtid userSlug
|
|
||||||
|
|
||||||
getSkel :: Maybe T.Text -> (User -> a) -> Handler (Maybe a)
|
|
||||||
getSkel mtid fun =
|
|
||||||
case mtid of
|
|
||||||
Just tid -> do
|
|
||||||
let uId = getUserIdFromText tid
|
|
||||||
user <- runDB $ getJust uId
|
|
||||||
return $ Just $ fun user
|
|
||||||
Nothing ->
|
|
||||||
return Nothing
|
|
||||||
|
|
||||||
getUserIdFromText :: T.Text -> UserId
|
getUserIdFromText :: T.Text -> UserId
|
||||||
getUserIdFromText tempUserId =
|
getUserIdFromText tempUserId =
|
||||||
case key of
|
case key of
|
||||||
|
|
Loading…
Reference in a new issue