core: catch error when toggling notifications (#954)

* core: catch error when toggling notifications

* filter current members

* filter active members
This commit is contained in:
Evgeny Poberezkin
2022-08-20 14:47:24 +01:00
committed by GitHub
parent 307db450d8
commit 164426db49
4 changed files with 5 additions and 5 deletions
+2 -2
View File
@@ -610,8 +610,8 @@ processChatCommand = \case
Group _ ms <- getGroup db user chatId
liftIO $ updateGroupSettings db user chatId chatSettings
pure ms
withAgent $ \a -> forM_ ms $ \m ->
forM_ (memberConnId m) $ \connId -> toggleConnectionNtfs a connId (enableNtfs chatSettings)
forM_ (filter memberActive ms) $ \m -> forM_ (memberConnId m) $ \connId ->
withAgent (\a -> toggleConnectionNtfs a connId $ enableNtfs chatSettings) `catchError` (toView . CRChatError)
pure CRCmdOk
_ -> pure $ chatCmdError "not supported"
APIContactInfo contactId -> withUser $ \User {userId} -> do