pressing enter without input results in player search failure

This commit is contained in:
Jonathan Lamothe 2019-09-26 01:36:10 -04:00
parent 75803edfe7
commit c7c267b2a1

View File

@ -168,7 +168,9 @@ selectPlayerPrompt pStr callback = Prompt
sel
C.moveCursor row col
, promptCharCheck = const True
, promptAction = \sStr -> do
, promptAction = \sStr -> if null sStr
then callback Nothing
else do
players <- gets $ view $ database.dbPlayers
case playerSearchExact sStr players of
Just (n, _) -> callback $ Just n