Listen to events so that encryption icon updates when status changes#28407
Conversation
| throttle( | ||
| () => { | ||
| if (client.getCrypto()) { | ||
| console.log("getting status"); |
There was a problem hiding this comment.
this is not a helpful console message
There was a problem hiding this comment.
ugh. I thought I removed all my debugging messages, but I forgot that one.
BillCarsonFr
left a comment
There was a problem hiding this comment.
Can't say much about react stuffs :/
There are no test for membership changes?
| [client, room], | ||
| ); | ||
|
|
||
| useEffect(updateEncryptionStatus, [updateEncryptionStatus]); |
There was a problem hiding this comment.
I am not familiar with that, the second arg are dependencies? So is this not a cyclic dependencies?
There was a problem hiding this comment.
the dependencies specify when useEffect should be called. So this says call updateEncryptionState whenever the method changes, and the method is a useMemo with its own dependencies, so it changes when [client, room] (either) changes.
There is a test for membership changes at https://github.com/element-hq/element-web/pull/28407/files#diff-5463cabfb673ce908cb151cfb23ca1085a6a510c7d9f897c76379408ace43fe3R652-R671 |
Fixes #28164
Checklist
public/exportedsymbols have accurate TSDoc documentation.