mirror of
https://github.com/mastodon/mastodon.git
synced 2025-01-31 14:31:43 +01:00
[Glitch] Fix scroll position resetting when opening media modals in web UI
Port 50755a47b4f0999f8c49501ff4fa4c2ef676fa0e to glitch-soc Signed-off-by: Thibaut Girka <thib@sitedethib.com>
This commit is contained in:
parent
e7fd43c27c
commit
0d42111671
@ -49,6 +49,10 @@ export default class Mastodon extends React.PureComponent {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
shouldUpdateScroll (_, { location }) {
|
||||||
|
return !(location.state && location.state.mastodonModalOpen);
|
||||||
|
}
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
const { locale } = this.props;
|
const { locale } = this.props;
|
||||||
|
|
||||||
@ -57,7 +61,7 @@ export default class Mastodon extends React.PureComponent {
|
|||||||
<Provider store={store}>
|
<Provider store={store}>
|
||||||
<ErrorBoundary>
|
<ErrorBoundary>
|
||||||
<BrowserRouter basename='/web'>
|
<BrowserRouter basename='/web'>
|
||||||
<ScrollContext>
|
<ScrollContext shouldUpdateScroll={this.shouldUpdateScroll}>
|
||||||
<Route path='/' component={UI} />
|
<Route path='/' component={UI} />
|
||||||
</ScrollContext>
|
</ScrollContext>
|
||||||
</BrowserRouter>
|
</BrowserRouter>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user