diff --git a/src/common/ipc.ts b/src/common/ipc.ts index d4bd1da7c5..9d36c7ccb1 100644 --- a/src/common/ipc.ts +++ b/src/common/ipc.ts @@ -18,7 +18,7 @@ export async function requestMain(channel: string, ...args: any[]) { } function getSubFrames(): ClusterFrameInfo[] { - return Array.from(clusterFrameMap.values()); + return toJS(Array.from(clusterFrameMap.values())); } export async function broadcastMessage(channel: string, ...args: any[]) { @@ -80,6 +80,6 @@ export function unsubscribeAllFromBroadcast(channel: string) { export function bindBroadcastHandlers() { handleRequest(subFramesChannel, async () => { - return toJS(await getSubFrames(), { recurseEverything: true }); + return await getSubFrames(), { recurseEverything: true }; }); } diff --git a/src/renderer/components/+workspaces/add-workspace.tsx b/src/renderer/components/+workspaces/add-workspace.tsx index d0ddcf2d65..e9fc6e11f4 100644 --- a/src/renderer/components/+workspaces/add-workspace.tsx +++ b/src/renderer/components/+workspaces/add-workspace.tsx @@ -16,7 +16,7 @@ const uniqueWorkspaceName: InputValidator = { @observer export class AddWorkspace extends React.Component { onSubmit(name: string) { - if (name.trim() === "") { + if (!name.trim()) { return; } const workspace = workspaceStore.addWorkspace(new Workspace({ diff --git a/src/renderer/components/command-palette/command-container.tsx b/src/renderer/components/command-palette/command-container.tsx index ccd9f74d42..34ab71ee67 100644 --- a/src/renderer/components/command-palette/command-container.tsx +++ b/src/renderer/components/command-palette/command-container.tsx @@ -30,7 +30,7 @@ export class CommandOverlay { @observer export class CommandContainer extends React.Component<{cluster?: Cluster}> { - @observable commandComponent: React.ReactElement; + @observable.ref commandComponent: React.ReactElement; private escHandler(event: KeyboardEvent) { if (event.key === "Escape") { @@ -55,14 +55,6 @@ export class CommandContainer extends React.Component<{cluster?: Cluster}> { }); } - onClusterAction(commandId: string) { - const command = this.findCommandById(commandId); - - if (command) { - this.runCommand(command); - } - } - componentDidMount() { if (this.props.cluster) { subscribeToBroadcast(`command-palette:run-action:${this.props.cluster.id}`, (event, commandId: string) => {