Fixed circular dependencies

Summary: Fixed circular dependency warnings and removed some dead code while at it.

Reviewed By: jknoxville

Differential Revision: D20557313

fbshipit-source-id: 856c42113a9abe36d3e14f9d538eb40705ceb87f
This commit is contained in:
Michel Weststrate
2020-03-23 06:42:08 -07:00
committed by Facebook GitHub Bot
parent aa2879d6e8
commit f2da075acc
3 changed files with 14 additions and 7 deletions

View File

@@ -466,10 +466,15 @@ export const selectDevice = (payload: BaseDevice): Action => ({
payload, payload,
}); });
export const setStaticView = (payload: StaticView): Action => ({ export const setStaticView = (payload: StaticView): Action => {
if (!payload) {
throw new Error('Cannot set empty static view');
}
return {
type: 'SET_STATIC_VIEW', type: 'SET_STATIC_VIEW',
payload, payload,
}); };
};
export const preferDevice = (payload: string): Action => ({ export const preferDevice = (payload: string): Action => ({
type: 'PREFER_DEVICE', type: 'PREFER_DEVICE',

View File

@@ -9,7 +9,6 @@
import {Actions, Store} from './'; import {Actions, Store} from './';
import {setStaticView} from './connections'; import {setStaticView} from './connections';
import SupportRequestFormV2 from '../fb-stubs/SupportRequestFormV2';
import {deconstructClientId} from '../utils/clientUtils'; import {deconstructClientId} from '../utils/clientUtils';
import {starPlugin as setStarPlugin} from './connections'; import {starPlugin as setStarPlugin} from './connections';
import {showStatusUpdatesForDuration} from '../utils/promiseTimeout'; import {showStatusUpdatesForDuration} from '../utils/promiseTimeout';
@@ -114,7 +113,9 @@ export class Group {
source: 'deeplink', source: 'deeplink',
group: this.name, group: this.name,
}); });
store.dispatch(setStaticView(SupportRequestFormV2)); store.dispatch(
setStaticView(require('../fb-stubs/SupportRequestFormV2').default),
);
const selectedApp = store.getState().connections.selectedApp; const selectedApp = store.getState().connections.selectedApp;
const selectedClient = store.getState().connections.clients.find(o => { const selectedClient = store.getState().connections.clients.find(o => {
return o.id === store.getState().connections.selectedApp; return o.id === store.getState().connections.selectedApp;

View File

@@ -9,7 +9,8 @@
import React from 'react'; import React from 'react';
import ReactDOM from 'react-dom'; import ReactDOM from 'react-dom';
import {Element, styled} from '../../../ui'; import {Element} from './ElementsInspector';
import styled from '@emotion/styled';
export function VisualizerPortal(props: { export function VisualizerPortal(props: {
container: HTMLElement; container: HTMLElement;