From 51a7c537f8eed1001a312f20a7d897a068365bb2 Mon Sep 17 00:00:00 2001 From: Vitaliy Vlasov Date: Tue, 18 Dec 2018 02:31:59 +0200 Subject: [PATCH] Fix desktop msg loading and signin Signed-off-by: Vitaliy Vlasov --- src/status_im/node/core.cljs | 5 +---- src/status_im/ui/screens/desktop/main/chat/views.cljs | 8 ++++++-- .../ui/screens/desktop/main/tabs/home/views.cljs | 2 ++ 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/status_im/node/core.cljs b/src/status_im/node/core.cljs index f9597e1793..aa4842e72f 100644 --- a/src/status_im/node/core.cljs +++ b/src/status_im/node/core.cljs @@ -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)))) diff --git a/src/status_im/ui/screens/desktop/main/chat/views.cljs b/src/status_im/ui/screens/desktop/main/chat/views.cljs index 9b6544da5d..d5cc66bf75 100644 --- a/src/status_im/ui/screens/desktop/main/chat/views.cljs +++ b/src/status_im/ui/screens/desktop/main/chat/views.cljs @@ -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) diff --git a/src/status_im/ui/screens/desktop/main/tabs/home/views.cljs b/src/status_im/ui/screens/desktop/main/tabs/home/views.cljs index 25a96a824c..9fd68a4b90 100644 --- a/src/status_im/ui/screens/desktop/main/tabs/home/views.cljs +++ b/src/status_im/ui/screens/desktop/main/tabs/home/views.cljs @@ -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))