}
defaultShouldUpdateScroll = (prevRouterProps, { location }) => {
- if ((((prevRouterProps || {}).location || {}).state || {}).mastodonModalOpen) return false;
- return !(location.state && location.state.mastodonModalOpen);
+ return !(prevRouterProps?.location?.state?.mastodonModalKey || location.state?.mastodonModalKey);
}
handleLoadPending = e => {
handleOpen = () => {
let state = {...this.context.router.history.location.state};
- if (state.mastodonModalOpen) {
+ if (state.mastodonModalKey) {
this.context.router.history.replace(`/statuses/${this.props.status.get('id')}`, { mastodonBackSteps: (state.mastodonBackSteps || 0) + 1 });
} else {
state.mastodonBackSteps = (state.mastodonBackSteps || 0) + 1;
}
shouldUpdateScroll (_, { location }) {
- return !(location.state && location.state.mastodonModalOpen);
+ return !(location.state?.mastodonModalKey);
}
render () {
}
shouldUpdateScroll = (prevRouterProps, { location }) => {
- if ((((prevRouterProps || {}).location || {}).state || {}).mastodonModalOpen) return false;
- return !(location.state && location.state.mastodonModalOpen);
+ return !(prevRouterProps?.location?.state?.mastodonModalKey || location.state?.mastodonModalKey);
}
setColumnRef = c => {
}
shouldUpdateScroll = (prevRouterProps, { location }) => {
- if ((((prevRouterProps || {}).location || {}).state || {}).mastodonModalOpen) return false;
- return !(location.state && location.state.mastodonModalOpen);
+ return !(prevRouterProps?.location?.state?.mastodonModalKey || location.state?.mastodonModalKey);
}
render () {