[Glitch] Fix scroll position resetting when opening media modals in web UI
Port ad91a0578b
to glitch-soc
Signed-off-by: Thibaut Girka <thib@sitedethib.com>
This commit is contained in:
parent
8193445a3d
commit
96469fb187
1 changed files with 5 additions and 1 deletions
|
@ -49,6 +49,10 @@ export default class Mastodon extends React.PureComponent {
|
|||
}
|
||||
}
|
||||
|
||||
shouldUpdateScroll (_, { location }) {
|
||||
return !(location.state && location.state.mastodonModalOpen);
|
||||
}
|
||||
|
||||
render () {
|
||||
const { locale } = this.props;
|
||||
|
||||
|
@ -57,7 +61,7 @@ export default class Mastodon extends React.PureComponent {
|
|||
<Provider store={store}>
|
||||
<ErrorBoundary>
|
||||
<BrowserRouter basename='/web'>
|
||||
<ScrollContext>
|
||||
<ScrollContext shouldUpdateScroll={this.shouldUpdateScroll}>
|
||||
<Route path='/' component={UI} />
|
||||
</ScrollContext>
|
||||
</BrowserRouter>
|
||||
|
|
Loading…
Reference in a new issue