Created
January 17, 2019 15:23
-
-
Save LucianU/310bff3681f260d80e3e6037c7394831 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
approveOtp :: | |
Session -> | |
Session | |
approveOtp (Session session) = let approveOtpV = execState (do | |
modify_ ((\{ approved } -> | |
{ approved: "F" | |
})) | |
if Array.any (\(Event e) -> | |
String.toLower (fromMaybe "null" e.label) == "approve_otp") session.events | |
then modify_ ((\{ approved } -> | |
{ approved: "T" | |
})) | |
else modify_ ((\st -> | |
st)) | |
modify_ ((\{ approveOtp } -> | |
{ approveOtp: Just approved | |
}))) { foo: Nothing | |
} | |
in Session $ session { approveOtp = approveOtpV | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment