-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
MatrixChat: only start session load once #30642
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
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.