From 4b459ea1430a4947364562f1a9881596325696ad Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Tue, 29 Sep 2020 10:14:27 +0200 Subject: [PATCH] fix(exams): default exam mode to Nothing --- src/Handler/Utils/Form.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Handler/Utils/Form.hs b/src/Handler/Utils/Form.hs index 5a5845426..25053ed09 100644 --- a/src/Handler/Utils/Form.hs +++ b/src/Handler/Utils/Form.hs @@ -1961,9 +1961,9 @@ customPresetForm :: forall a custom preset msg. -> Maybe (Maybe a) -> AForm Handler (Maybe a) customPresetForm cpL noneOption customOption toOption customForm fs mPrev - = explainedMultiActionA actionMap options fs mPrev' + = explainedMultiActionA actionMap options fs $ Just mPrev' where - mPrev' = flip fmap mPrev $ preview (_Just . cpL) >>> \case + mPrev' = case mPrev ^? _Just . _Just . cpL of Nothing -> CPFONone Just (Left _) -> CPFOCustom Just (Right p) -> CPFOPreset p