mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-02-23 23:54:13 +08:00
fix(popover): Add isMounted check, Sentry 20951
This commit is contained in:
parent
3fa93c2730
commit
b05ea801b0
1 changed files with 7 additions and 0 deletions
|
@ -45,6 +45,7 @@ class FixedPopover extends Component {
|
|||
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.mounted = false;
|
||||
this.updateCount = 0
|
||||
this.fallback = this.props.fallbackDirection;
|
||||
this.state = {
|
||||
|
@ -55,6 +56,7 @@ class FixedPopover extends Component {
|
|||
}
|
||||
|
||||
componentDidMount() {
|
||||
this.mounted = true;
|
||||
window.addEventListener('resize', this.onWindowResize)
|
||||
this.focusElementWithTabIndex();
|
||||
_.defer(this.onPopoverRendered)
|
||||
|
@ -78,6 +80,7 @@ class FixedPopover extends Component {
|
|||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
this.mounted = false;
|
||||
window.removeEventListener('resize', this.onWindowResize)
|
||||
}
|
||||
|
||||
|
@ -86,6 +89,10 @@ class FixedPopover extends Component {
|
|||
}
|
||||
|
||||
onPopoverRendered = ()=> {
|
||||
if (!this.mounted) {
|
||||
return;
|
||||
}
|
||||
|
||||
const {direction} = this.state
|
||||
const currentRect = this.getCurrentRect()
|
||||
const windowDimensions = this.getWindowDimensions()
|
||||
|
|
Loading…
Reference in a new issue