Minor improvements in handling offline applications

Summary:
Some minor loose ends from exploratory testing:

- disconnect device logs event listeners if the device disconnects
- show metro if that is still up, even if the app is no longer connected
- hide the options in the support form to record videos / screenshots if the device isn't connected

Reviewed By: nikoant

Differential Revision: D26277100

fbshipit-source-id: 49d0c934d587b226bc25524224efce60b53939e9
This commit is contained in:
Michel Weststrate
2021-02-09 04:12:09 -08:00
committed by Facebook GitHub Bot
parent 54f9ff260b
commit 3b6be6b7b6
2 changed files with 4 additions and 1 deletions

View File

@@ -225,6 +225,7 @@ export default class BaseDevice {
} }
disconnect() { disconnect() {
this.logListeners.clear();
this.connected.set(false); this.connected.set(false);
} }

View File

@@ -86,6 +86,8 @@ export const PluginList = memo(function PluginList({
pluginsChanged, pluginsChanged,
]); ]);
const isConnected = useValue(activeDevice?.connected, false); const isConnected = useValue(activeDevice?.connected, false);
const metroConnected = useValue(metroDevice?.connected, false);
const isArchived = activeDevice?.isArchived;
const annotatedDownloadablePlugins = useMemoize< const annotatedDownloadablePlugins = useMemoize<
[ [
@@ -198,7 +200,7 @@ export const PluginList = memo(function PluginList({
))} ))}
</PluginGroup> </PluginGroup>
{isConnected && ( {!isArchived && metroConnected && (
<PluginGroup <PluginGroup
key="metro" key="metro"
title="React Native" title="React Native"