Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

core: set active prompt to none when changing current user #1738

Merged
merged 1 commit into from Jan 13, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/Simplex/Chat.hs
Expand Up @@ -277,6 +277,7 @@ processChatCommand = \case
[] -> pure 1
_ -> withAgent (`createUser` smp)
user <- withStore $ \db -> createUserRecord db (AgentUserId auId) p True
setActive ActiveNone
atomically . writeTVar u $ Just user
pure $ CRActiveUser user
ListUsers -> do
Expand All @@ -285,13 +286,15 @@ processChatCommand = \case
APISetActiveUser userId -> do
u <- asks currentUser
user <- withStore $ \db -> getSetActiveUser db userId
setActive ActiveNone
atomically . writeTVar u $ Just user
pure $ CRActiveUser user
SetActiveUser uName -> withUserName uName APISetActiveUser
APIDeleteUser _userId -> do
-- prohibit to delete active user
-- withStore' $ \db -> deleteUser db userId
-- ? other cleanup
setActive ActiveNone
pure $ CRCmdOk Nothing
DeleteUser uName -> withUserName uName APIDeleteUser
StartChat subConns enableExpireCIs -> withUser' $ \user ->
Expand Down