mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-04-26 13:08:02 +00:00
fix: initially blocked keys (#94)
This commit is contained in:
committed by
GitHub
parent
7c6d67634c
commit
6caab6f539
@@ -63,7 +63,7 @@ basicReceiveFromTTY ct =
|
||||
forever $ getLn >>= atomically . writeTBQueue (inputQ ct)
|
||||
|
||||
basicSendToTTY :: ChatTerminal -> IO ()
|
||||
basicSendToTTY ct = forever $ atomically (readOutputQ ct) >>= mapM_ putStyledLn
|
||||
basicSendToTTY ct = forever $ readOutputQ ct >>= mapM_ putStyledLn
|
||||
|
||||
withTermLock :: MonadTerminal m => ChatTerminal -> m () -> m ()
|
||||
withTermLock ChatTerminal {termLock} action = do
|
||||
@@ -94,11 +94,12 @@ receiveFromTTY ct@ChatTerminal {inputQ, activeContact, termSize, termState} =
|
||||
withTermLock ct $ printMessage ct [styleMessage msg]
|
||||
|
||||
sendToTTY :: ChatTerminal -> IO ()
|
||||
sendToTTY ct = withTerminal . runTerminalT . forever $ do
|
||||
msg <- atomically $ readOutputQ ct
|
||||
withTermLock ct $ do
|
||||
sendToTTY ct = forever $ do
|
||||
-- `readOutputQ` should be outside of `withTerminal` (see #94)
|
||||
msg <- readOutputQ ct
|
||||
withTerminal . runTerminalT . withTermLock ct $ do
|
||||
printMessage ct msg
|
||||
updateInput ct
|
||||
|
||||
readOutputQ :: ChatTerminal -> STM [StyledString]
|
||||
readOutputQ = readTBQueue . outputQ
|
||||
readOutputQ :: ChatTerminal -> IO [StyledString]
|
||||
readOutputQ = atomically . readTBQueue . outputQ
|
||||
|
||||
Reference in New Issue
Block a user