Separate Client in server and client part

Summary: This diff separates the concept of a Client as now on the UI, from the concept of a Client as known on the server, and makes all interactions with client and vice versa async.

Reviewed By: timur-valiev

Differential Revision: D31235682

fbshipit-source-id: 99089e9b390b4c5359f97f6f2b15bf4b182b6cb9
This commit is contained in:
Michel Weststrate
2021-10-06 09:08:47 -07:00
committed by Facebook GitHub Bot
parent eab4804792
commit 740093d0d9
17 changed files with 276 additions and 201 deletions

View File

@@ -49,6 +49,7 @@ import {produce} from 'immer';
import {reportUsage} from './utils/metrics';
import {PluginInfo} from './chrome/fb-stubs/PluginInfo';
import {getActiveClient, getActivePlugin} from './selectors/connections';
import {isTest} from './utils/isProduction';
const {Text, Link} = Typography;
@@ -250,7 +251,7 @@ class PluginContainer extends PureComponent<Props, State> {
render() {
const {activePlugin, pluginKey, target, pendingMessages} = this.props;
if (!activePlugin || !target || !pluginKey) {
return null;
return this.renderNoPluginActive();
}
if (activePlugin.status !== 'enabled') {
return this.renderPluginInfo();
@@ -294,6 +295,9 @@ class PluginContainer extends PureComponent<Props, State> {
}
renderNoPluginActive() {
if (isTest()) {
return <>No plugin selected</>; // to keep 'nothing' clearly recognisable in unit tests
}
return (
<View grow>
<Waiting>