From d37f1c282a358cf83f301052249a753319915307 Mon Sep 17 00:00:00 2001 From: Michel Weststrate Date: Wed, 17 Feb 2021 08:17:37 -0800 Subject: [PATCH] Fixed issue with reseting logs Summary: Noticed that subsequent `adb logcat` invocations are stateful, and we didn't clear it's state when clearing the logs in memory. This is a bandaid to get back to the previous behavior. I am wondering whether it wouldn't be just much more intuitive to always clear the logs (`adb logcat -c`) before we start the streaming log listener, so that users are never shown old logs from before flipper was connected? Also fixed a leak in cleaning up the log listeners that was revealed by the possibility to disable the log plugin Reviewed By: nikoant Differential Revision: D26450262 fbshipit-source-id: 5b426e2d0e1fafdbc512d48d22b7bd4f30b61309 --- .../app/src/sandy-chrome/appinspect/LaunchEmulator.tsx | 6 ++++-- desktop/flipper-plugin/src/plugin/PluginBase.tsx | 8 ++++++-- desktop/plugins/logs/index.tsx | 2 ++ 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/desktop/app/src/sandy-chrome/appinspect/LaunchEmulator.tsx b/desktop/app/src/sandy-chrome/appinspect/LaunchEmulator.tsx index 56b54ee5b..dde7d8e4c 100644 --- a/desktop/app/src/sandy-chrome/appinspect/LaunchEmulator.tsx +++ b/desktop/app/src/sandy-chrome/appinspect/LaunchEmulator.tsx @@ -76,7 +76,9 @@ export const LaunchEmulatorDialog = withTrackingScope( }, [iosEnabled, getSimulators, store]); const items = [ - ...(androidEmulators.length > 0 ? [] : []), + ...(androidEmulators.length > 0 + ? [] + : []), ...androidEmulators.map((name) => { const launch = (coldBoot: boolean) => { launchEmulator(name, coldBoot) @@ -111,7 +113,7 @@ export const LaunchEmulatorDialog = withTrackingScope( ); }), - ...(iosEmulators.length > 0 ? [] : []), + ...(iosEmulators.length > 0 ? [] : []), ...iosEmulators.map((device) => (