Clear entries from the device when logs are cleared

Summary: Before this diff "Clear Logs" didn't used to clear the log entries from the redux store. It just used to update the state, so when you switched back from other plugins, all previous log information used to pop up again. This diff fixes that.

Reviewed By: passy

Differential Revision: D16012710

fbshipit-source-id: 4393520ab6f77caa5f286e22446d2cb6d0827d71
This commit is contained in:
Pritesh Nandgaonkar
2019-06-27 06:53:11 -07:00
committed by Facebook Github Bot
parent 43495fa64c
commit c38a55d98f
3 changed files with 7 additions and 0 deletions

View File

@@ -84,6 +84,7 @@ export default class AndroidDevice extends BaseDevice {
}
clearLogs(): Promise<void> {
this.logEntries = [];
return child_process_promise.spawn('adb', ['logcat', '-c']);
}

View File

@@ -39,6 +39,11 @@ export default class ArchivedDevice extends BaseDevice {
return this.logs;
}
clearLogs(): Promise<void> {
this.logs = [];
return Promise.resolve();
}
spawnShell(): ?DeviceShell {
return null;
}

View File

@@ -127,6 +127,7 @@ export default class BaseDevice {
clearLogs(): Promise<void> {
// Only for device types that allow clearing.
this.logEntries = [];
return Promise.resolve();
}