Do not scroll timelines when *closing* media modals
Media modals push an history state so that pressing back on mobile closes them. We made sure to not scroll when opening them, but not when *closing* them, which caused some issues in rare cases.lolsob-rspec
parent
086cf8a8d7
commit
b4bab7eb35
|
@ -150,6 +150,7 @@ export default class ScrollableList extends PureComponent {
|
||||||
}
|
}
|
||||||
|
|
||||||
defaultShouldUpdateScroll = (prevRouterProps, { location }) => {
|
defaultShouldUpdateScroll = (prevRouterProps, { location }) => {
|
||||||
|
if ((((prevRouterProps || {}).location || {}).state || {}).mastodonModalOpen) return false;
|
||||||
return !(location.state && location.state.mastodonModalOpen);
|
return !(location.state && location.state.mastodonModalOpen);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -90,7 +90,8 @@ export default class AccountGallery extends ImmutablePureComponent {
|
||||||
}
|
}
|
||||||
|
|
||||||
shouldUpdateScroll = (prevRouterProps, { location }) => {
|
shouldUpdateScroll = (prevRouterProps, { location }) => {
|
||||||
return !(location.state && location.state.mastodonModalOpen)
|
if ((((prevRouterProps || {}).location || {}).state || {}).mastodonModalOpen) return false;
|
||||||
|
return !(location.state && location.state.mastodonModalOpen);
|
||||||
}
|
}
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
|
|
|
@ -43,7 +43,8 @@ export default class Blocks extends ImmutablePureComponent {
|
||||||
}
|
}
|
||||||
|
|
||||||
shouldUpdateScroll = (prevRouterProps, { location }) => {
|
shouldUpdateScroll = (prevRouterProps, { location }) => {
|
||||||
return !(location.state && location.state.mastodonModalOpen)
|
if ((((prevRouterProps || {}).location || {}).state || {}).mastodonModalOpen) return false;
|
||||||
|
return !(location.state && location.state.mastodonModalOpen);
|
||||||
}
|
}
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
|
|
|
@ -34,6 +34,7 @@ export default class Favourites extends ImmutablePureComponent {
|
||||||
}
|
}
|
||||||
|
|
||||||
shouldUpdateScroll = (prevRouterProps, { location }) => {
|
shouldUpdateScroll = (prevRouterProps, { location }) => {
|
||||||
|
if ((((prevRouterProps || {}).location || {}).state || {}).mastodonModalOpen) return false;
|
||||||
return !(location.state && location.state.mastodonModalOpen);
|
return !(location.state && location.state.mastodonModalOpen);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -43,6 +43,7 @@ export default class FollowRequests extends ImmutablePureComponent {
|
||||||
}
|
}
|
||||||
|
|
||||||
shouldUpdateScroll = (prevRouterProps, { location }) => {
|
shouldUpdateScroll = (prevRouterProps, { location }) => {
|
||||||
|
if ((((prevRouterProps || {}).location || {}).state || {}).mastodonModalOpen) return false;
|
||||||
return !(location.state && location.state.mastodonModalOpen);
|
return !(location.state && location.state.mastodonModalOpen);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -57,6 +57,7 @@ export default class Followers extends ImmutablePureComponent {
|
||||||
}
|
}
|
||||||
|
|
||||||
shouldUpdateScroll = (prevRouterProps, { location }) => {
|
shouldUpdateScroll = (prevRouterProps, { location }) => {
|
||||||
|
if ((((prevRouterProps || {}).location || {}).state || {}).mastodonModalOpen) return false;
|
||||||
return !(location.state && location.state.mastodonModalOpen);
|
return !(location.state && location.state.mastodonModalOpen);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -57,7 +57,8 @@ export default class Following extends ImmutablePureComponent {
|
||||||
}
|
}
|
||||||
|
|
||||||
shouldUpdateScroll = (prevRouterProps, { location }) => {
|
shouldUpdateScroll = (prevRouterProps, { location }) => {
|
||||||
return !(location.state && location.state.mastodonModalOpen)
|
if ((((prevRouterProps || {}).location || {}).state || {}).mastodonModalOpen) return false;
|
||||||
|
return !(location.state && location.state.mastodonModalOpen);
|
||||||
}
|
}
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
|
|
|
@ -43,6 +43,7 @@ export default class Mutes extends ImmutablePureComponent {
|
||||||
}
|
}
|
||||||
|
|
||||||
shouldUpdateScroll = (prevRouterProps, { location }) => {
|
shouldUpdateScroll = (prevRouterProps, { location }) => {
|
||||||
|
if ((((prevRouterProps || {}).location || {}).state || {}).mastodonModalOpen) return false;
|
||||||
return !(location.state && location.state.mastodonModalOpen);
|
return !(location.state && location.state.mastodonModalOpen);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -34,6 +34,7 @@ export default class Reblogs extends ImmutablePureComponent {
|
||||||
}
|
}
|
||||||
|
|
||||||
shouldUpdateScroll = (prevRouterProps, { location }) => {
|
shouldUpdateScroll = (prevRouterProps, { location }) => {
|
||||||
|
if ((((prevRouterProps || {}).location || {}).state || {}).mastodonModalOpen) return false;
|
||||||
return !(location.state && location.state.mastodonModalOpen);
|
return !(location.state && location.state.mastodonModalOpen);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -364,7 +364,8 @@ export default class Status extends ImmutablePureComponent {
|
||||||
}
|
}
|
||||||
|
|
||||||
shouldUpdateScroll = (prevRouterProps, { location }) => {
|
shouldUpdateScroll = (prevRouterProps, { location }) => {
|
||||||
return !(location.state && location.state.mastodonModalOpen)
|
if ((((prevRouterProps || {}).location || {}).state || {}).mastodonModalOpen) return false;
|
||||||
|
return !(location.state && location.state.mastodonModalOpen);
|
||||||
}
|
}
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
|
|
Loading…
Reference in New Issue