[Fixes: #9900] Use component-did-update

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>
This commit is contained in:
Andrea Maria Piana 2020-01-27 09:12:32 +01:00 committed by yenda
parent 33abdf559a
commit 238b559981
No known key found for this signature in database
GPG Key ID: 0095623C0069DCE6
1 changed files with 1 additions and 1 deletions

View File

@ -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]))