Fix a crash if a device disconnected while a Sheet was open

Summary:
A temporarily hack that was a left-over from the past where we could switch between Sandy and non-Sandy UI, caused Flipper to crash.

This is the first runtime crash we find with the new Crash reporting dialog last week :)

Changelog: Fixed an issue where Flipper could occasionally crash when disconnecting a device

Reviewed By: passy

Differential Revision: D26634620

fbshipit-source-id: 5ca0b14dee332859a4d8af27501f0916c55a1370
This commit is contained in:
Michel Weststrate
2021-02-24 07:54:17 -08:00
committed by Facebook GitHub Bot
parent d7e584627a
commit 3a6d7517a4

View File

@@ -76,8 +76,6 @@ class Sheet extends Component<Props, State> {
}
componentWillUnmount() {
// When switching to Sandy, we need to short-circuit this as this component itself will be thrown away
this.props.onHideSheet();
document.removeEventListener('keydown', this.onKeyDown);
}