Skip to content

Commit

Permalink
core: set active prompt to none when changing current user (#1738)
Browse files Browse the repository at this point in the history
  • Loading branch information
spaced4ndy committed Jan 13, 2023
1 parent 0c3d643 commit 9290fcc
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Simplex/Chat.hs
Expand Up @@ -280,6 +280,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 @@ -288,13 +289,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

0 comments on commit 9290fcc

Please sign in to comment.