From 14795f203b70d19619ebd0b70ec3ff0042b1e4b1 Mon Sep 17 00:00:00 2001 From: Andrey Goncharov Date: Fri, 10 Mar 2023 10:00:46 -0800 Subject: [PATCH] Stop using device API to clear device logs on disconnected devices Reviewed By: lblasa Differential Revision: D43979493 fbshipit-source-id: d05450ad4f5e9e1a1336f6a825875d4670725252 --- desktop/plugins/public/logs/index.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/desktop/plugins/public/logs/index.tsx b/desktop/plugins/public/logs/index.tsx index ccea40ca4..bd7b62c98 100644 --- a/desktop/plugins/public/logs/index.tsx +++ b/desktop/plugins/public/logs/index.tsx @@ -184,7 +184,9 @@ export function devicePlugin(client: DevicePluginClient) { } async function clearLogs() { - await client.device.clearLogs(); + if (client.device.connected.get()) { + await client.device.clearLogs(); + } rows.clear(); tableManagerRef.current?.clearSelection(); }