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

Fixing JS error on channel leave or being removed from the channel #4437

Merged
merged 1 commit into from
Dec 4, 2019

Conversation

jespino
Copy link
Member

@jespino jespino commented Dec 4, 2019

Summary

Fixing JS error on channel leave or being removed from the channel. If the
channelId was undefined or the channelId is not longer rendered there is no
ref, we need to check that before we try to use the ref.

Ticket Link

MM-20929
MM-20920

@jespino jespino added 2: Dev Review Requires review by a core commiter 3: QA Review Requires review by a QA tester CherryPick/Approved Meant for the quality or patch release tracked in the milestone labels Dec 4, 2019
@jespino jespino added this to the v5.18.0 milestone Dec 4, 2019
const curChannel = this.refs[channelId].getWrappedInstance().refs.channel.getBoundingClientRect();
if ((curChannel.top - Constants.CHANNEL_SCROLL_ADJUSTMENT < 0) || (curChannel.top + curChannel.height > this.refs.scrollbar.view.getBoundingClientRect().height)) {
this.refs.scrollbar.scrollTop(this.refs.scrollbar.view.scrollTop + (curChannel.top - Constants.CHANNEL_SCROLL_ADJUSTMENT));
if (this.refs[channelId]) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Candidate for a HW campaign, change the refs to the new format

Copy link
Member Author

Choose a reason for hiding this comment

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

Added to the spreadsheet

Copy link
Contributor

@stevemudie stevemudie left a comment

Choose a reason for hiding this comment

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

QA will test once merged

@amyblais amyblais added 4: Reviews Complete All reviewers have approved the pull request and removed 2: Dev Review Requires review by a core commiter labels Dec 4, 2019
@amyblais amyblais removed the 3: QA Review Requires review by a QA tester label Dec 4, 2019
@jespino jespino merged commit 9fee649 into mattermost:master Dec 4, 2019
@jespino jespino deleted the MM-20929 branch December 4, 2019 21:52
@mattermod mattermod added CherryPick/Done Successfully cherry-picked to the quality or patch release tracked in the milestone and removed CherryPick/Approved Meant for the quality or patch release tracked in the milestone labels Dec 4, 2019
@amyblais amyblais added Changelog/Not Needed Does not require a changelog entry Docs/Not Needed Does not require documentation labels Dec 5, 2019
@lindalumitchell lindalumitchell added the Tests/Done Release tests have been written label Dec 11, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
4: Reviews Complete All reviewers have approved the pull request Changelog/Not Needed Does not require a changelog entry CherryPick/Done Successfully cherry-picked to the quality or patch release tracked in the milestone Docs/Not Needed Does not require documentation Tests/Done Release tests have been written
Projects
None yet
7 participants