~cytrogen/masto-fe

8ef1a95b1c77fcac2a5ea2a5060fc7d3a073729d — Claire 2 years ago 7b325aa + 4c2aca7
Merge commit '4c2aca777f6ae6942d0cf11aee56a925694ccdef' into glitch-soc/merge-upstream
1 files changed, 13 insertions(+), 3 deletions(-)

M app/javascript/mastodon/features/status/index.jsx
M app/javascript/mastodon/features/status/index.jsx => app/javascript/mastodon/features/status/index.jsx +13 -3
@@ 220,6 220,8 @@ class Status extends ImmutablePureComponent {

  componentDidMount () {
    attachFullscreenListener(this.onFullScreenChange);

    this._scrollStatusIntoView();
  }

  UNSAFE_componentWillReceiveProps (nextProps) {


@@ 579,10 581,10 @@ class Status extends ImmutablePureComponent {
    this.node = c;
  };

  componentDidUpdate (prevProps) {
    const { status, ancestorsIds, multiColumn } = this.props;
  _scrollStatusIntoView () {
    const { status, multiColumn } = this.props;

    if (status && (ancestorsIds.size > prevProps.ancestorsIds.size || prevProps.status?.get('id') !== status.get('id'))) {
    if (status) {
      window.requestAnimationFrame(() => {
        this.node?.querySelector('.detailed-status__wrapper')?.scrollIntoView(true);



@@ 599,6 601,14 @@ class Status extends ImmutablePureComponent {
    }
  }

  componentDidUpdate (prevProps) {
    const { status, ancestorsIds } = this.props;

    if (status && (ancestorsIds.size > prevProps.ancestorsIds.size || prevProps.status?.get('id') !== status.get('id'))) {
      this._scrollStatusIntoView();
    }
  }

  componentWillUnmount () {
    detachFullscreenListener(this.onFullScreenChange);
  }