WIP
This commit is contained in:
parent
88b7439c48
commit
c757835ca3
|
@ -68,7 +68,7 @@
|
|||
"discovery.summary"
|
||||
(summary cofx (transforms/js->clj event-js))
|
||||
|
||||
"local-notifications"
|
||||
"local-notifications" ;; WIP: when it's edited, The signal is not received, but the message is
|
||||
(local-notifications/process cofx (transforms/js->clj event-js))
|
||||
|
||||
"community.found"
|
||||
|
|
|
@ -81,21 +81,23 @@
|
|||
|
||||
(defn ensure-chats
|
||||
[{:keys [db] :as cofx} [chats]]
|
||||
(let [{:keys [view-id current-chat-id]} db
|
||||
{:keys [all-chats chats-home-list removed-chats]}
|
||||
(let [{:keys [view-id current-chat-id]}
|
||||
db
|
||||
|
||||
{:keys [all-chats chats-home-list removed-chats] :as x}
|
||||
(reduce
|
||||
(fn [acc {:keys [chat-id community-id active muted] :as chat}]
|
||||
(if (not (or active muted))
|
||||
(if-not (or active muted)
|
||||
(update acc :removed-chats conj chat-id)
|
||||
(cond-> acc
|
||||
(and (not community-id) active)
|
||||
(update :chats-home-list conj chat-id)
|
||||
:always
|
||||
(assoc-in [:all-chats chat-id] chat))))
|
||||
(and (not community-id) active) (update :chats-home-list conj chat-id)
|
||||
:always (assoc-in [:all-chats chat-id] chat))))
|
||||
{:all-chats {}
|
||||
:chats-home-list #{}
|
||||
:removed-chats #{}}
|
||||
(map (map-chats cofx) chats))]
|
||||
(map (map-chats cofx) chats))
|
||||
|
||||
_ (def --x x)]
|
||||
{:db (-> db
|
||||
(update :chats merge all-chats)
|
||||
(update :chats-home-list set/union chats-home-list)
|
||||
|
|
|
@ -62,9 +62,9 @@
|
|||
^js watch-only-accounts (.-watchOnlyAccounts response-js)
|
||||
sync-handler (when-not process-async process-response)]
|
||||
(cond
|
||||
|
||||
(seq chats)
|
||||
(do
|
||||
(def --c chats)
|
||||
(js-delete response-js "chats")
|
||||
(rf/merge cofx
|
||||
(process-next response-js sync-handler)
|
||||
|
@ -155,7 +155,7 @@
|
|||
|
||||
(seq removed-messages)
|
||||
(let [removed-messages-clj (types/js->clj removed-messages)]
|
||||
(js-delete response-js "removedMessages")
|
||||
(js-delete response-js "removedMessages") ;; TODO: check removed messages too
|
||||
(rf/merge cofx
|
||||
(process-next response-js sync-handler)
|
||||
(models.message/handle-removed-messages removed-messages-clj)))
|
||||
|
|
|
@ -35,9 +35,10 @@
|
|||
|
||||
(defn create-notification
|
||||
[cofx {:keys [bodyType] :as notification}]
|
||||
(def --n notification)
|
||||
(assoc
|
||||
(case bodyType
|
||||
"message" (when (show-message-pn? cofx notification) notification)
|
||||
"message" (when true #_(show-message-pn? cofx notification) notification)
|
||||
"transaction" (notifications.wallet/create-transfer-notification cofx notification)
|
||||
nil)
|
||||
:body-type
|
||||
|
|
Loading…
Reference in New Issue