chat: fix broken chat delete logic (#1343)
* chat: fix broken chat delete logic Previously, persisting the chat delete functionality was working only for group chats, where the `debug?` flag decided if delete was a real "hard" delete (deleting data from the realm database) or just marking with the `inactive` flag. However non-group chats were not deleted at all, which I believe is a bug fixed by this commit. * chat: fix broken chat delete logic Fix the branching logic with `if` instead of `when`
This commit is contained in:
parent
fc7cc1d795
commit
fa8fe11bd7
|
@ -392,10 +392,9 @@
|
||||||
(defn delete-chat!
|
(defn delete-chat!
|
||||||
[_ [_ chat-id]]
|
[_ [_ chat-id]]
|
||||||
(let [{:keys [debug? group-chat]} (chats/get-by-id chat-id)]
|
(let [{:keys [debug? group-chat]} (chats/get-by-id chat-id)]
|
||||||
(when group-chat
|
(if (and (not debug?) group-chat)
|
||||||
(if debug?
|
(chats/set-inactive chat-id)
|
||||||
(chats/delete chat-id)
|
(chats/delete chat-id))))
|
||||||
(chats/set-inactive chat-id)))))
|
|
||||||
|
|
||||||
(defn remove-pending-messages!
|
(defn remove-pending-messages!
|
||||||
[_ [_ chat-id]]
|
[_ [_ chat-id]]
|
||||||
|
|
Loading…
Reference in New Issue