pressing enter without input results in player search failure
This commit is contained in:
parent
75803edfe7
commit
c7c267b2a1
|
@ -168,23 +168,25 @@ selectPlayerPrompt pStr callback = Prompt
|
||||||
sel
|
sel
|
||||||
C.moveCursor row col
|
C.moveCursor row col
|
||||||
, promptCharCheck = const True
|
, promptCharCheck = const True
|
||||||
, promptAction = \sStr -> do
|
, promptAction = \sStr -> if null sStr
|
||||||
players <- gets $ view $ database.dbPlayers
|
then callback Nothing
|
||||||
case playerSearchExact sStr players of
|
else do
|
||||||
Just (n, _) -> callback $ Just n
|
players <- gets $ view $ database.dbPlayers
|
||||||
Nothing -> do
|
case playerSearchExact sStr players of
|
||||||
mode <- gets $ view progMode
|
Just (n, _) -> callback $ Just n
|
||||||
let
|
Nothing -> do
|
||||||
cps
|
mode <- gets $ view progMode
|
||||||
= newCreatePlayerState
|
let
|
||||||
& cpsName .~ sStr
|
cps
|
||||||
& cpsSuccessCallback .~ do
|
= newCreatePlayerState
|
||||||
modify $ progMode .~ mode
|
& cpsName .~ sStr
|
||||||
callback (Just 0)
|
& cpsSuccessCallback .~ do
|
||||||
& cpsFailureCallback .~ do
|
modify $ progMode .~ mode
|
||||||
modify $ progMode .~ mode
|
callback (Just 0)
|
||||||
callback Nothing
|
& cpsFailureCallback .~ do
|
||||||
modify $ progMode .~ CreatePlayer cps
|
modify $ progMode .~ mode
|
||||||
|
callback Nothing
|
||||||
|
modify $ progMode .~ CreatePlayer cps
|
||||||
, promptSpecialKey = \case
|
, promptSpecialKey = \case
|
||||||
C.KeyFunction n -> do
|
C.KeyFunction n -> do
|
||||||
sStr <- gets $ view inputBuffer
|
sStr <- gets $ view inputBuffer
|
||||||
|
|
Loading…
Reference in New Issue
Block a user