Type: Bug
Summary: Add to contacts screen appears for less than a second when user joins public chat
I do want clear screen transitions. When i join public chat there is nothing i want to add to contacts. This screen should not flash even for a milisecond.
Add to contacts appears for a while when joining to public chat
Again can reproduce in RC 0.10.1, nightly 04.03.2109
@yenda take a look when you have time, thanks!
I have a theory/take on this:
It happens because more often than not (maybe always) (not group-chat) in
(when (and (not group-chat)
(models.contact/can-add-to-contacts? contact))
[add-contact-bar chat-id])
becomes true because group-chat is nil and not because it is false
perhaps because when joining new public chat, upserting the chat and updating current-chat-id to the new chat in the app-db, happens after navigating to it, and not as we intended/assumed it to happen before.
I fixed it in my local wip PR for #7454 by subscribing to [:chats/current-chat-id] and adding another condition (= current-chat-id chat-id) in the and form above.
But, there might be better solutions, perhaps by changing the ordering of effects in definition/registration of navigate-to-chat or even start-public-chat. Unsure because re-frame docs on Effects says:
Order Of Effects?
There isn't one.
Probably should've made a separate PR for this particular issue, but, encountering it while working on #7454, whose issues were in a way overlapping with this, was bothersome. So fix for this according to reasoning proposed above, is included in #7454 which is now merged.
@churik is the issue still reproducible on current develop or nightly?
Yeah, it is not, so seems #7454 fixed it.
Thanks @bitsikka !