Fix desktop msg loading and signin

Signed-off-by: Vitaliy Vlasov <siphiuel@gmail.com>
This commit is contained in:
Vitaliy Vlasov 2018-12-18 02:31:59 +02:00
parent 8be8f0b5c8
commit 51a7c537f8
No known key found for this signature in database
GPG Key ID: A7D57C347F2B2964
3 changed files with 9 additions and 6 deletions

View File

@ -159,10 +159,7 @@
(let [restart {:db (assoc db :node/restart? true :node/address address)}]
(case status
:started nil
:starting (do
(when utils.platform/desktop?
(status/stop-node))
restart)
:starting restart
:stopping restart
(start cofx address))))

View File

@ -206,8 +206,12 @@
current-public-key [:account/public-key]
messages-to-load (reagent/atom load-step)
chat-id* (reagent/atom nil)]
{:component-did-update #(load-more (count messages) messages-to-load)
:component-did-mount #(load-more (count messages) messages-to-load)}
{:component-did-update #(if (:messages-initialized? (second (.-argv (.-props %1))))
(load-more (count messages) messages-to-load)
(re-frame/dispatch [:chat.ui/load-more-messages]))
:component-did-mount #(if (:messages-initialized? (second (.-argv (.-props %1))))
(load-more (count messages) messages-to-load)
(re-frame/dispatch [:chat.ui/load-more-messages]))}
(let [scroll-ref (atom nil)
scroll-timer (atom nil)
scroll-height (atom nil)

View File

@ -21,6 +21,7 @@
(views/defview chat-list-item-inner-view [{:keys [chat-id name group-chat
color public? public-key
timestamp
last-message-content
last-message-type]
:as chat-item}]
@ -29,6 +30,7 @@
chat-name [:chats/chat-name chat-id]
current-chat-id [:chats/current-chat-id]]
(let [last-message {:content last-message-content
:timestamp timestamp
:message-type last-message-type}
name (or chat-name
(gfycat/generate-gfy public-key))