MatrixChat: only start session load once#30642
Conversation
When running in development mode, `MatrixChat.componentDidMount` is run twice, meaning it checks the session lock twice. Sometimes, this means it shows the "Element is running in another window" page. The real problem is of course that we're running all this application logic inside the `MatrixChat` component, but as a quick workaround, we can just remember that we've started the session load code, and bail out on the second pass.
t3chguy
left a comment
There was a problem hiding this comment.
This being in the c'tor is a bit of a foot-gun, one wouldn't expect a c'tor to bail early and they may add code at the end, such as the resize listener was and end up suffering
Can you break it out into a private method at least
t3chguy
left a comment
There was a problem hiding this comment.
This being in the c'tor is a bit of a foot-gun, one wouldn't expect a c'tor to bail early and they may add code at the end, such as the resize listener was and end up suffering
Can you break it out into a private method at least
|
or invert the condition and move the relevant code into the if edit: the diff was confusing, not the c'tor, |
done |
* MatrixChat: only start session load once When running in development mode, `MatrixChat.componentDidMount` is run twice, meaning it checks the session lock twice. Sometimes, this means it shows the "Element is running in another window" page. The real problem is of course that we're running all this application logic inside the `MatrixChat` component, but as a quick workaround, we can just remember that we've started the session load code, and bail out on the second pass. * Address review comments
* MatrixChat: only start session load once When running in development mode, `MatrixChat.componentDidMount` is run twice, meaning it checks the session lock twice. Sometimes, this means it shows the "Element is running in another window" page. The real problem is of course that we're running all this application logic inside the `MatrixChat` component, but as a quick workaround, we can just remember that we've started the session load code, and bail out on the second pass. * Address review comments
When running in development mode,
MatrixChat.componentDidMountis run twice,meaning it checks the session lock twice. Sometimes, this means it shows the
"Element is running in another window" page.
The real problem is of course that we're running all this application logic
inside the
MatrixChatcomponent, but as a quick workaround, we can justremember that we've started the session load code, and bail out on the second pass.