mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2025-12-24 20:26:24 +00:00
MainHeader: Ensure unmount doesn't double-remove on popperRoot
This commit is contained in:
committed by
Ken Powers
parent
c5ea29d1f1
commit
3aff3ed181
@@ -127,7 +127,7 @@ export class MainHeader extends React.Component<PropsType, StateType> {
|
||||
popperRoot: null,
|
||||
});
|
||||
|
||||
if (popperRoot) {
|
||||
if (popperRoot && document.body.contains(popperRoot)) {
|
||||
document.body.removeChild(popperRoot);
|
||||
}
|
||||
};
|
||||
@@ -138,7 +138,7 @@ export class MainHeader extends React.Component<PropsType, StateType> {
|
||||
document.removeEventListener('click', this.handleOutsideClick);
|
||||
document.removeEventListener('keydown', this.handleOutsideKeyDown);
|
||||
|
||||
if (popperRoot) {
|
||||
if (popperRoot && document.body.contains(popperRoot)) {
|
||||
document.body.removeChild(popperRoot);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user