Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Fix one variant of a scroll jump that occurs when decrypting an m.text #1656

Merged
merged 3 commits into from
Dec 15, 2017

Conversation

lukebarnard1
Copy link
Contributor

This calls onWidgetLoad after an event has been decrypted or a device verification has changed. It isn't called after a forceUpdate() in _onDecrypted but empirically the change reduces scroll jumps in e2e rooms.

Copy link
Member

@richvdh richvdh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hrm. Does verification actually ever cause a resize? I'm thinking not, because the dom node is allocated and sized at initial render.

Should this not therefore be happening in _onDecrypted (or rather, on the callback of forceUpdate)?

(in case you missed it: _verifyEvent is asynchronous)

@@ -215,6 +215,7 @@ module.exports = withMatrixClient(React.createClass({
this.setState({
verified: verified,
});
this.props.onWidgetLoad();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't this be in the setState callback, so it happens after the content is rendered?

@richvdh richvdh assigned lukebarnard1 and unassigned richvdh Dec 15, 2017
@lukebarnard1
Copy link
Contributor Author

Well it changes the classes on the event tile so I'd rather just assume that it does cause a change.

It's true that it should be in the callback of setState though despite my previous optimistic empiricism.

@richvdh
Copy link
Member

richvdh commented Dec 15, 2017

ok well in that case stick comments in _onDecrypted to say that the onWidgetLoad is happening in _verifyEvent. (And possibly one in _verifyEvent to say that it is covering the decryption.)

@lukebarnard1 lukebarnard1 assigned richvdh and unassigned lukebarnard1 Dec 15, 2017
Copy link
Member

@richvdh richvdh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@richvdh richvdh assigned lukebarnard1 and unassigned richvdh Dec 15, 2017
@lukebarnard1 lukebarnard1 merged commit d2066f4 into develop Dec 15, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants