simple welcome message (#152)

* simple welcome message

* show welcome message only once

* show onboarding progress
This commit is contained in:
Evgeny Poberezkin
2021-12-13 12:05:57 +00:00
committed by GitHub
parent 7fa671f829
commit 20e7feb953
6 changed files with 91 additions and 5 deletions
+4
View File
@@ -1,5 +1,6 @@
module Simplex.Chat.Util where
import Control.Monad (when)
import Data.ByteString.Char8 (ByteString)
import Data.Text (Text)
import Data.Text.Encoding (decodeUtf8With)
@@ -12,5 +13,8 @@ safeDecodeUtf8 = decodeUtf8With onError
ifM :: Monad m => m Bool -> m a -> m a -> m a
ifM ba t f = ba >>= \b -> if b then t else f
whenM :: Monad m => m Bool -> m () -> m ()
whenM ba a = ba >>= (`when` a)
unlessM :: Monad m => m Bool -> m () -> m ()
unlessM b = ifM b $ pure ()