Skip to content
This repository has been archived by the owner on Nov 22, 2024. It is now read-only.

Commit

Permalink
Register Flipper self inspection client under its own device
Browse files Browse the repository at this point in the history
Summary:
There is currently a separate device for the Flipper inspection plugin. Figured it would be simpler and more logical to directly put it under the host device.

Might clean this up further in the future by having a `host` device and turning this into a device plugin

Reviewed By: fabiomassimo

Differential Revision: D26691053

fbshipit-source-id: 4f2fe890a1fff559b19b1599cc02017c45a635b9
  • Loading branch information
mweststrate authored and facebook-github-bot committed Feb 26, 2021
1 parent 86e700f commit a5cd18c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 33 deletions.
18 changes: 0 additions & 18 deletions desktop/app/src/devices/FlipperSelfInspectionDevice.tsx

This file was deleted.

25 changes: 10 additions & 15 deletions desktop/app/src/utils/self-inspection/selfInspectionUtils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

import Client, {ClientQuery} from '../../Client';
import {FlipperClientConnection} from '../../Client';
import FlipperSelfInspectionDevice from '../../devices/FlipperSelfInspectionDevice';
import {Store} from '../../reducers';
import {Logger} from '../../fb-interfaces/Logger';

Expand All @@ -31,25 +30,21 @@ export function initSelfInpector(
>,
) {
const appName = 'Flipper';
const device_id = 'FlipperSelfInspectionDevice';
const device = new FlipperSelfInspectionDevice(
device_id,
'emulator',
appName,
'JSWebApp',
);
store.dispatch({
type: 'REGISTER_DEVICE',
payload: device,
});

selfInspectionClient.addPlugin(flipperMessagesClientPlugin);
const hostDevice = store
.getState()
.connections.devices.find((d) => d.serial === '');
if (!hostDevice) {
console.error('Failed to find host device for self inspector');
return;
}

const query: ClientQuery = {
app: appName,
os: 'JSWebApp',
os: 'MacOS',
device: 'emulator',
device_id,
device_id: '',
sdk_version: 4,
};
const clientId = buildClientId(query);
Expand All @@ -61,7 +56,7 @@ export function initSelfInpector(
logger,
store,
undefined,
device,
hostDevice,
);

flipperConnections.set(clientId, {
Expand Down

0 comments on commit a5cd18c

Please sign in to comment.