fix ids for chats created after receiving from unknown id

This commit is contained in:
Roman Volosovskyi 2016-05-30 11:49:16 +03:00
parent 32b10794d2
commit b914493283
2 changed files with 7 additions and 6 deletions

View File

@ -36,7 +36,7 @@
[drawer-view [drawer-view
[view st/chats-container [view st/chats-container
[chats-list-toolbar] [chats-list-toolbar]
[list-view {:dataSource (to-datasource (vals @chats)) [list-view {:dataSource (to-datasource @chats)
:renderRow (fn [row _ _] :renderRow (fn [row _ _]
(list-item [chat-list-item row])) (list-item [chat-list-item row]))
:style st/list-container}] :style st/list-container}]

View File

@ -1,17 +1,18 @@
(ns status-im.chats-list.views.chat-list-item (ns status-im.chats-list.views.chat-list-item
(:require [re-frame.core :refer [subscribe dispatch dispatch-sync]] (:require [re-frame.core :refer [subscribe dispatch dispatch-sync]]
[status-im.components.react :refer [view [status-im.components.react :refer [view
text text
image image
touchable-highlight]] touchable-highlight]]
[status-im.components.styles :refer [font]] [status-im.components.styles :refer [font]]
[status-im.chats-list.views.inner-item :refer [status-im.chats-list.views.inner-item :refer
[chat-list-item-inner-view]])) [chat-list-item-inner-view]]))
(defn chat-list-item [{:keys [chat-id] :as chat}] (defn chat-list-item [[chat-id chat]]
[touchable-highlight [touchable-highlight
{:on-press #(dispatch [:navigate-to :chat chat-id])} {:on-press #(dispatch [:navigate-to :chat chat-id])}
[view [chat-list-item-inner-view (merge chat [view [chat-list-item-inner-view (merge chat
;; TODO stub data ;; TODO stub data
{:new-messages-count 3 {:chat-id chat-id
:new-messages-count 3
:online true})]]]) :online true})]]])