Use BaseDevice from flipper-frontend-core in flipper-ui-core
Summary: Use BasDevice definition from flipper-frontend-core in flipper-ui-core and remove the redundant definition from flipper-ui-core Reviewed By: lblasa Differential Revision: D37234785 fbshipit-source-id: 6e768090a197c1d2c49cb1cd573acea12fb65d24
This commit is contained in:
committed by
Facebook GitHub Bot
parent
ef5fa275a3
commit
fd380a4c1e
@@ -21,7 +21,7 @@ import {
|
||||
} from '../../__tests__/test-utils/createMockFlipperWithPlugin';
|
||||
import {Store} from '..';
|
||||
import {getActiveClient, getActiveDevice} from '../../selectors/connections';
|
||||
import BaseDevice from '../../devices/BaseDevice';
|
||||
import {BaseDevice} from 'flipper-frontend-core';
|
||||
import Client from '../../Client';
|
||||
import {
|
||||
mockConsole,
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
import {ComponentType} from 'react';
|
||||
import {produce} from 'immer';
|
||||
|
||||
import type BaseDevice from '../devices/BaseDevice';
|
||||
import type {BaseDevice} from 'flipper-frontend-core';
|
||||
import type Client from '../Client';
|
||||
import type {UninitializedClient, DeviceOS, Logger} from 'flipper-common';
|
||||
import type {Actions} from '.';
|
||||
@@ -243,15 +243,11 @@ export default (state: State = INITAL_STATE, action: Actions): State => {
|
||||
selectedAppId =
|
||||
getAllClients(state).find(
|
||||
(c) =>
|
||||
// TODO: Remove after migration
|
||||
// @ts-expect-error
|
||||
c.device === payload && c.query.app === state.userPreferredApp,
|
||||
)?.id ?? null;
|
||||
// nothing found, try first app if any
|
||||
if (!selectedAppId) {
|
||||
selectedAppId =
|
||||
// TODO: Remove after migration
|
||||
// @ts-expect-error
|
||||
getAllClients(state).find((c) => c.device === payload)?.id ?? null;
|
||||
}
|
||||
}
|
||||
@@ -284,11 +280,7 @@ export default (state: State = INITAL_STATE, action: Actions): State => {
|
||||
return {
|
||||
...state,
|
||||
staticView: null,
|
||||
// TODO: Remove after migration
|
||||
// @ts-expect-error
|
||||
selectedDevice: device,
|
||||
// TODO: Remove after migration
|
||||
// @ts-expect-error
|
||||
userPreferredDevice: canBeDefaultDevice(device)
|
||||
? device.title
|
||||
: state.userPreferredDevice,
|
||||
@@ -345,8 +337,6 @@ export default (state: State = INITAL_STATE, action: Actions): State => {
|
||||
return {
|
||||
...state,
|
||||
selectedAppId: payload,
|
||||
// TODO: Remove after migration
|
||||
// @ts-expect-error
|
||||
selectedDevice: client.device,
|
||||
userPreferredDevice: client.device.title,
|
||||
userPreferredApp: client.query.app,
|
||||
|
||||
Reference in New Issue
Block a user