Skip to content

Commit

Permalink
[Fixes: #9900] Use component-did-update
Browse files Browse the repository at this point in the history
When moving from chat to chat, component-did-mount is not fired as the
component is never unmounted, therefore messages were not loaded.
This changes the behavior to use the component-did-update lifecycle
method.

Signed-off-by: yenda <eric@status.im>
  • Loading branch information
cammellos authored and yenda committed Jan 27, 2020
1 parent 33abdf5 commit 238b559
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/status_im/ui/screens/chat/views.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@
modal?]
(letsubs [messages [:chats/current-chat-messages-stream]
current-public-key [:multiaccount/public-key]]
{:component-did-mount
{:component-did-update
(fn [args]
(when-not (:messages-initialized? (second (.-argv (.-props args))))
(re-frame/dispatch [:chat.ui/load-more-messages]))
Expand Down

0 comments on commit 238b559

Please sign in to comment.