File tree Expand file tree Collapse file tree
app/javascript/mastodon/containers Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -12,6 +12,8 @@ import { hydrateStore } from '../actions/store';
1212import { connectUserStream } from '../actions/streaming' ;
1313import { IntlProvider , addLocaleData } from 'react-intl' ;
1414import { getLocale } from '../locales' ;
15+ import { previewState as previewMediaState } from 'mastodon/features/ui/components/media_modal' ;
16+ import { previewState as previewVideoState } from 'mastodon/features/ui/components/video_modal' ;
1517import initialState from '../initial_state' ;
1618import ErrorBoundary from '../components/error_boundary' ;
1719
@@ -35,6 +37,10 @@ class MastodonMount extends React.PureComponent {
3537 showIntroduction : PropTypes . bool ,
3638 } ;
3739
40+ shouldUpdateScroll ( _ , { location } ) {
41+ return location . state !== previewMediaState && location . state !== previewVideoState ;
42+ }
43+
3844 render ( ) {
3945 const { showIntroduction } = this . props ;
4046
@@ -44,7 +50,7 @@ class MastodonMount extends React.PureComponent {
4450
4551 return (
4652 < BrowserRouter basename = '/web' >
47- < ScrollContext >
53+ < ScrollContext shouldUpdateScroll = { this . shouldUpdateScroll } >
4854 < Route path = '/' component = { UI } />
4955 </ ScrollContext >
5056 </ BrowserRouter >
You can’t perform that action at this time.
0 commit comments