From fe86b79adb22ddd13956ec0650cf8486ed369b3a Mon Sep 17 00:00:00 2001 From: Sebastian Malton Date: Fri, 17 Feb 2023 09:50:12 -0500 Subject: [PATCH] Convert seting cluster frame to be IPC injectable Signed-off-by: Sebastian Malton --- .../src/common/cluster-frames.injectable.ts | 11 ++++-- packages/core/src/common/cluster-frames.ts | 13 ------- packages/core/src/common/ipc/cluster.ts | 1 - packages/core/src/common/ipc/ipc.ts | 10 ++--- .../request-from-channel-injection-token.ts | 4 ++ .../cluster/frame-id/common/channel.ts | 11 ++++++ .../main/handle-set-frame-id.injectable.ts | 29 ++++++++++++++ .../request-set-frame-id.injectable.ts | 21 ++++++++++ .../setup-ipc-main-handlers.injectable.ts | 39 ++++++++----------- .../setup-ipc-main-handlers.ts | 20 +++------- ...raw-request-channel-listener.injectable.ts | 29 ++++++++++++++ .../channel-listeners/listener-tokens.ts | 38 ++++++++++++++++++ ...istening-on-request-channels.injectable.ts | 12 ++++-- .../init-cluster-frame.injectable.ts | 3 +- packages/core/src/renderer/ipc/index.ts | 6 +-- 15 files changed, 176 insertions(+), 71 deletions(-) delete mode 100644 packages/core/src/common/cluster-frames.ts create mode 100644 packages/core/src/features/cluster/frame-id/common/channel.ts create mode 100644 packages/core/src/features/cluster/frame-id/main/handle-set-frame-id.injectable.ts create mode 100644 packages/core/src/features/cluster/frame-id/renderer/request-set-frame-id.injectable.ts create mode 100644 packages/core/src/main/utils/channel/channel-listeners/enlist-raw-request-channel-listener.injectable.ts diff --git a/packages/core/src/common/cluster-frames.injectable.ts b/packages/core/src/common/cluster-frames.injectable.ts index 23897012a0..7f8f8d65fe 100644 --- a/packages/core/src/common/cluster-frames.injectable.ts +++ b/packages/core/src/common/cluster-frames.injectable.ts @@ -3,12 +3,17 @@ * Licensed under MIT License. See LICENSE in root directory for more information. */ import { getInjectable } from "@ogre-tools/injectable"; -import { clusterFrameMap } from "./cluster-frames"; +import { observable } from "mobx"; +import type { ClusterId } from "./cluster-types"; + +export interface ClusterFrameInfo { + frameId: number; + processId: number; +} const clusterFramesInjectable = getInjectable({ id: "cluster-frames", - instantiate: () => clusterFrameMap, - causesSideEffects: true, + instantiate: () => observable.map(), }); export default clusterFramesInjectable; diff --git a/packages/core/src/common/cluster-frames.ts b/packages/core/src/common/cluster-frames.ts deleted file mode 100644 index 6a4757e68a..0000000000 --- a/packages/core/src/common/cluster-frames.ts +++ /dev/null @@ -1,13 +0,0 @@ -/** - * Copyright (c) OpenLens Authors. All rights reserved. - * Licensed under MIT License. See LICENSE in root directory for more information. - */ - -import { observable } from "mobx"; - -export interface ClusterFrameInfo { - frameId: number; - processId: number; -} - -export const clusterFrameMap = observable.map(); diff --git a/packages/core/src/common/ipc/cluster.ts b/packages/core/src/common/ipc/cluster.ts index 53061abf60..376e07acff 100644 --- a/packages/core/src/common/ipc/cluster.ts +++ b/packages/core/src/common/ipc/cluster.ts @@ -4,7 +4,6 @@ */ export const clusterActivateHandler = "cluster:activate"; -export const clusterSetFrameIdHandler = "cluster:set-frame-id"; export const clusterVisibilityHandler = "cluster:visibility"; export const clusterDisconnectHandler = "cluster:disconnect"; export const clusterStates = "cluster:states"; diff --git a/packages/core/src/common/ipc/ipc.ts b/packages/core/src/common/ipc/ipc.ts index e84fcfec56..1212310c42 100644 --- a/packages/core/src/common/ipc/ipc.ts +++ b/packages/core/src/common/ipc/ipc.ts @@ -9,13 +9,12 @@ import { ipcMain, ipcRenderer, webContents } from "electron"; import { toJS } from "../utils/toJS"; -import type { ClusterFrameInfo } from "../cluster-frames"; -import { clusterFrameMap } from "../cluster-frames"; import type { Disposer } from "../utils"; import { getLegacyGlobalDiForExtensionApi } from "../../extensions/as-legacy-globals-for-extension-api/legacy-global-di-for-extension-api"; import ipcRendererInjectable from "../../renderer/utils/channel/ipc-renderer.injectable"; import loggerInjectable from "../logger.injectable"; import ipcMainInjectionToken from "./ipc-main-injection-token"; +import clusterFramesInjectable from "../cluster-frames.injectable"; export const broadcastMainChannel = "ipc:broadcast-main"; @@ -29,10 +28,6 @@ export function ipcMainHandle(channel: string, listener: (event: Electron.IpcMai }); } -function getSubFrames(): ClusterFrameInfo[] { - return Array.from(clusterFrameMap.values()); -} - export async function broadcastMessage(channel: string, ...args: any[]): Promise { if (ipcRenderer) { return ipcRenderer.invoke(broadcastMainChannel, channel, ...args.map(sanitizePayload)); @@ -44,12 +39,13 @@ export async function broadcastMessage(channel: string, ...args: any[]): Promise const di = getLegacyGlobalDiForExtensionApi(); const logger = di.inject(loggerInjectable); + const clusterFrames = di.inject(clusterFramesInjectable); ipcMain.listeners(channel).forEach((func) => func({ processId: undefined, frameId: undefined, sender: undefined, senderFrame: undefined, }, ...args)); - const subFrames = getSubFrames(); + const subFrames = [...clusterFrames.values()]; const views = webContents.getAllWebContents(); if (!views || !Array.isArray(views) || views.length === 0) return; diff --git a/packages/core/src/common/utils/channel/request-from-channel-injection-token.ts b/packages/core/src/common/utils/channel/request-from-channel-injection-token.ts index 14e925f190..8db6bf709b 100644 --- a/packages/core/src/common/utils/channel/request-from-channel-injection-token.ts +++ b/packages/core/src/common/utils/channel/request-from-channel-injection-token.ts @@ -10,6 +10,10 @@ export interface RequestFromChannel { (channel: RequestChannel): Promise; } +export type ChannelRequester = Channel extends RequestChannel + ? (req: Req) => Promise + : never; + export const requestFromChannelInjectionToken = getInjectionToken({ id: "request-from-request-channel", }); diff --git a/packages/core/src/features/cluster/frame-id/common/channel.ts b/packages/core/src/features/cluster/frame-id/common/channel.ts new file mode 100644 index 0000000000..943a9b9238 --- /dev/null +++ b/packages/core/src/features/cluster/frame-id/common/channel.ts @@ -0,0 +1,11 @@ +/** + * Copyright (c) OpenLens Authors. All rights reserved. + * Licensed under MIT License. See LICENSE in root directory for more information. + */ + +import type { ClusterId } from "../../../../common/cluster-types"; +import type { RequestChannel } from "../../../../common/utils/channel/request-channel-listener-injection-token"; + +export const setClusterFrameIdChannel: RequestChannel = { + id: "set-cluster-frame-id", +}; diff --git a/packages/core/src/features/cluster/frame-id/main/handle-set-frame-id.injectable.ts b/packages/core/src/features/cluster/frame-id/main/handle-set-frame-id.injectable.ts new file mode 100644 index 0000000000..5962d5099d --- /dev/null +++ b/packages/core/src/features/cluster/frame-id/main/handle-set-frame-id.injectable.ts @@ -0,0 +1,29 @@ +/** + * Copyright (c) OpenLens Authors. All rights reserved. + * Licensed under MIT License. See LICENSE in root directory for more information. + */ +import clusterFramesInjectable from "../../../../common/cluster-frames.injectable"; +import getClusterByIdInjectable from "../../../../common/cluster-store/get-by-id.injectable"; +import pushCatalogToRendererInjectable from "../../../../main/catalog-sync-to-renderer/push-catalog-to-renderer.injectable"; +import { getRawRequestChannelListenerInjectable } from "../../../../main/utils/channel/channel-listeners/listener-tokens"; +import { setClusterFrameIdChannel } from "../common/channel"; + +const handleSetClusterFrameIdInjectable = getRawRequestChannelListenerInjectable({ + channel: setClusterFrameIdChannel, + handler: (di) => { + const getClusterById = di.inject(getClusterByIdInjectable); + const clusterFrames = di.inject(clusterFramesInjectable); + const pushCatalogToRenderer = di.inject(pushCatalogToRendererInjectable); + + return (event, clusterId) => { + const cluster = getClusterById(clusterId); + + if (cluster) { + clusterFrames.set(cluster.id, { frameId: event.frameId, processId: event.processId }); + pushCatalogToRenderer(); + } + }; + }, +}); + +export default handleSetClusterFrameIdInjectable; diff --git a/packages/core/src/features/cluster/frame-id/renderer/request-set-frame-id.injectable.ts b/packages/core/src/features/cluster/frame-id/renderer/request-set-frame-id.injectable.ts new file mode 100644 index 0000000000..acd5b4ef24 --- /dev/null +++ b/packages/core/src/features/cluster/frame-id/renderer/request-set-frame-id.injectable.ts @@ -0,0 +1,21 @@ +/** + * Copyright (c) OpenLens Authors. All rights reserved. + * Licensed under MIT License. See LICENSE in root directory for more information. + */ +import { getInjectable } from "@ogre-tools/injectable"; +import type { ChannelRequester } from "../../../../common/utils/channel/request-from-channel-injection-token"; +import requestFromChannelInjectable from "../../../../renderer/utils/channel/request-from-channel.injectable"; +import { setClusterFrameIdChannel } from "../common/channel"; + +export type RequestSetClusterFrameId = ChannelRequester; + +const requestSetClusterFrameIdInjectable = getInjectable({ + id: "request-set-cluster-frame-id", + instantiate: (di): RequestSetClusterFrameId => { + const requestFromChannel = di.inject(requestFromChannelInjectable); + + return (clusterId) => requestFromChannel(setClusterFrameIdChannel, clusterId); + }, +}); + +export default requestSetClusterFrameIdInjectable; diff --git a/packages/core/src/main/electron-app/runnables/setup-ipc-main-handlers/setup-ipc-main-handlers.injectable.ts b/packages/core/src/main/electron-app/runnables/setup-ipc-main-handlers/setup-ipc-main-handlers.injectable.ts index b8a869f7fe..19755c9029 100644 --- a/packages/core/src/main/electron-app/runnables/setup-ipc-main-handlers/setup-ipc-main-handlers.injectable.ts +++ b/packages/core/src/main/electron-app/runnables/setup-ipc-main-handlers/setup-ipc-main-handlers.injectable.ts @@ -4,40 +4,33 @@ */ import { getInjectable } from "@ogre-tools/injectable"; import { setupIpcMainHandlers } from "./setup-ipc-main-handlers"; -import loggerInjectable from "../../../../common/logger.injectable"; import clusterStoreInjectable from "../../../../common/cluster-store/cluster-store.injectable"; import { onLoadOfApplicationInjectionToken } from "../../../start-main-application/runnable-tokens/on-load-of-application-injection-token"; import applicationMenuItemCompositeInjectable from "../../../../features/application-menu/main/application-menu-item-composite.injectable"; import emitAppEventInjectable from "../../../../common/app-event-bus/emit-event.injectable"; import getClusterByIdInjectable from "../../../../common/cluster-store/get-by-id.injectable"; -import pushCatalogToRendererInjectable from "../../../catalog-sync-to-renderer/push-catalog-to-renderer.injectable"; +import clusterFramesInjectable from "../../../../common/cluster-frames.injectable"; +import prefixedLoggerInjectable from "../../../../common/logger/prefixed-logger.injectable"; const setupIpcMainHandlersInjectable = getInjectable({ id: "setup-ipc-main-handlers", - instantiate: (di) => { - const logger = di.inject(loggerInjectable); - const applicationMenuItemComposite = di.inject(applicationMenuItemCompositeInjectable); - const pushCatalogToRenderer = di.inject(pushCatalogToRendererInjectable); - const clusterStore = di.inject(clusterStoreInjectable); - const emitAppEvent = di.inject(emitAppEventInjectable); - const getClusterById = di.inject(getClusterByIdInjectable); + instantiate: (di) => ({ + id: "setup-ipc-main-handlers", + run: () => { + const logger = di.inject(prefixedLoggerInjectable, "APP-MAIN"); - return { - id: "setup-ipc-main-handlers", - run: () => { - logger.debug("[APP-MAIN] initializing ipc main handlers"); + logger.debug("initializing ipc main handlers"); - setupIpcMainHandlers({ - applicationMenuItemComposite, - pushCatalogToRenderer, - clusterStore, - emitAppEvent, - getClusterById, - }); - }, - }; - }, + setupIpcMainHandlers({ + applicationMenuItemComposite: di.inject(applicationMenuItemCompositeInjectable), + clusterStore: di.inject(clusterStoreInjectable), + emitAppEvent: di.inject(emitAppEventInjectable), + getClusterById: di.inject(getClusterByIdInjectable), + clusterFrameMap: di.inject(clusterFramesInjectable), + }); + }, + }), injectionToken: onLoadOfApplicationInjectionToken, causesSideEffects: true, diff --git a/packages/core/src/main/electron-app/runnables/setup-ipc-main-handlers/setup-ipc-main-handlers.ts b/packages/core/src/main/electron-app/runnables/setup-ipc-main-handlers/setup-ipc-main-handlers.ts index 4ae020c42d..0c82225d9b 100644 --- a/packages/core/src/main/electron-app/runnables/setup-ipc-main-handlers/setup-ipc-main-handlers.ts +++ b/packages/core/src/main/electron-app/runnables/setup-ipc-main-handlers/setup-ipc-main-handlers.ts @@ -2,14 +2,12 @@ * Copyright (c) OpenLens Authors. All rights reserved. * Licensed under MIT License. See LICENSE in root directory for more information. */ -import type { IpcMainInvokeEvent } from "electron"; import { BrowserWindow, Menu } from "electron"; -import { clusterFrameMap } from "../../../../common/cluster-frames"; -import { clusterActivateHandler, clusterSetFrameIdHandler, clusterDisconnectHandler, clusterStates } from "../../../../common/ipc/cluster"; +import { clusterActivateHandler, clusterDisconnectHandler, clusterStates } from "../../../../common/ipc/cluster"; import type { ClusterId } from "../../../../common/cluster-types"; import type { ClusterStore } from "../../../../common/cluster-store/cluster-store"; import { broadcastMainChannel, broadcastMessage, ipcMainHandle, ipcMainOn } from "../../../../common/ipc"; -import type { IComputedValue } from "mobx"; +import type { IComputedValue, ObservableMap } from "mobx"; import { windowActionHandleChannel, windowLocationChangedChannel, windowOpenAppMenuAsContextMenuChannel } from "../../../../common/ipc/window"; import { handleWindowAction, onLocationChange } from "../../../ipc/window"; import type { ApplicationMenuItemTypes } from "../../../../features/application-menu/main/menu-items/application-menu-item-injection-token"; @@ -18,12 +16,13 @@ import { getApplicationMenuTemplate } from "../../../../features/application-men import type { MenuItemRoot } from "../../../../features/application-menu/main/application-menu-item-composite.injectable"; import type { EmitAppEvent } from "../../../../common/app-event-bus/emit-event.injectable"; import type { GetClusterById } from "../../../../common/cluster-store/get-by-id.injectable"; +import type { ClusterFrameInfo } from "../../../../common/cluster-frames.injectable"; interface Dependencies { applicationMenuItemComposite: IComputedValue>; clusterStore: ClusterStore; emitAppEvent: EmitAppEvent; getClusterById: GetClusterById; - pushCatalogToRenderer: () => void; + clusterFrameMap: ObservableMap; } export const setupIpcMainHandlers = ({ @@ -31,22 +30,13 @@ export const setupIpcMainHandlers = ({ clusterStore, emitAppEvent, getClusterById, - pushCatalogToRenderer, + clusterFrameMap, }: Dependencies) => { ipcMainHandle(clusterActivateHandler, (event, clusterId: ClusterId, force = false) => { return getClusterById(clusterId) ?.activate(force); }); - ipcMainHandle(clusterSetFrameIdHandler, (event: IpcMainInvokeEvent, clusterId: ClusterId) => { - const cluster = getClusterById(clusterId); - - if (cluster) { - clusterFrameMap.set(cluster.id, { frameId: event.frameId, processId: event.processId }); - pushCatalogToRenderer(); - } - }); - ipcMainHandle(clusterDisconnectHandler, (event, clusterId: ClusterId) => { emitAppEvent({ name: "cluster", action: "stop" }); const cluster = getClusterById(clusterId); diff --git a/packages/core/src/main/utils/channel/channel-listeners/enlist-raw-request-channel-listener.injectable.ts b/packages/core/src/main/utils/channel/channel-listeners/enlist-raw-request-channel-listener.injectable.ts new file mode 100644 index 0000000000..3865b07058 --- /dev/null +++ b/packages/core/src/main/utils/channel/channel-listeners/enlist-raw-request-channel-listener.injectable.ts @@ -0,0 +1,29 @@ +/** + * Copyright (c) OpenLens Authors. All rights reserved. + * Licensed under MIT License. See LICENSE in root directory for more information. + */ +import { getInjectable } from "@ogre-tools/injectable"; +import type { Disposer } from "../../../../common/utils"; +import type { RequestChannel } from "../../../../common/utils/channel/request-channel-listener-injection-token"; +import type { RawRequestChannelListener } from "./listener-tokens"; +import ipcMainInjectionToken from "../../../../common/ipc/ipc-main-injection-token"; + +export type EnlistRawRequestChannelListener = >(listener: RawRequestChannelListener) => Disposer; + +const enlistRawRequestChannelListenerInjectable = getInjectable({ + id: "enlist-raw-request-channel-listener-for-main", + + instantiate: (di): EnlistRawRequestChannelListener => { + const ipcMain = di.inject(ipcMainInjectionToken); + + return ({ channel, handler }) => { + ipcMain.handle(channel.id, handler); + + return () => { + ipcMain.off(channel.id, handler); + }; + }; + }, +}); + +export default enlistRawRequestChannelListenerInjectable; diff --git a/packages/core/src/main/utils/channel/channel-listeners/listener-tokens.ts b/packages/core/src/main/utils/channel/channel-listeners/listener-tokens.ts index a3cd5af4f4..53d9ebe6db 100644 --- a/packages/core/src/main/utils/channel/channel-listeners/listener-tokens.ts +++ b/packages/core/src/main/utils/channel/channel-listeners/listener-tokens.ts @@ -5,22 +5,36 @@ import type { DiContainerForInjection } from "@ogre-tools/injectable"; import { getInjectable, getInjectionToken } from "@ogre-tools/injectable"; +import type { IpcMainInvokeEvent } from "electron"; import type { RequestChannel } from "../../../../common/utils/channel/request-channel-listener-injection-token"; export type RequestChannelHandler = Channel extends RequestChannel ? (req: Request) => Promise | Response : never; +export type RawRequestChannelHandler = Channel extends RequestChannel + ? (event: IpcMainInvokeEvent, req: Request) => Promise | Response + : never; + export interface RequestChannelListener { channel: Channel; handler: RequestChannelHandler; } +export interface RawRequestChannelListener { + channel: Channel; + handler: RawRequestChannelHandler; +} + export const requestChannelListenerInjectionToken = getInjectionToken>>( { id: "request-channel-listener", }); +export const rawRequestChannelListenerInjectionToken = getInjectionToken>>( { + id: "raw-request-channel-listener", +}); + export interface GetRequestChannelListenerInjectableInfo< Channel extends RequestChannel, Request, @@ -44,3 +58,27 @@ export function getRequestChannelListenerInjectable< injectionToken: requestChannelListenerInjectionToken, }); } + +export interface GeRawtRequestChannelListenerInjectableInfo< + Channel extends RequestChannel, + Request, + Response, +> { + channel: Channel; + handler: (di: DiContainerForInjection) => RawRequestChannelHandler; +} + +export function getRawRequestChannelListenerInjectable< + Channel extends RequestChannel, + Request, + Response, +>(info: GeRawtRequestChannelListenerInjectableInfo) { + return getInjectable({ + id: `${info.channel.id}-listener`, + instantiate: (di) => ({ + channel: info.channel, + handler: info.handler(di), + }), + injectionToken: rawRequestChannelListenerInjectionToken, + }); +} diff --git a/packages/core/src/main/utils/channel/channel-listeners/listening-on-request-channels.injectable.ts b/packages/core/src/main/utils/channel/channel-listeners/listening-on-request-channels.injectable.ts index 80b94fbe0e..66e9cd6f16 100644 --- a/packages/core/src/main/utils/channel/channel-listeners/listening-on-request-channels.injectable.ts +++ b/packages/core/src/main/utils/channel/channel-listeners/listening-on-request-channels.injectable.ts @@ -6,19 +6,22 @@ import { getInjectable } from "@ogre-tools/injectable"; import { disposer } from "../../../../common/utils"; import type { RequestChannel } from "../../../../common/utils/channel/request-channel-listener-injection-token"; import { getStartableStoppable } from "../../../../common/utils/get-startable-stoppable"; +import enlistRawRequestChannelListenerInjectable from "./enlist-raw-request-channel-listener.injectable"; import enlistRequestChannelListenerInjectable from "./enlist-request-channel-listener.injectable"; -import { requestChannelListenerInjectionToken } from "./listener-tokens"; +import { rawRequestChannelListenerInjectionToken, requestChannelListenerInjectionToken } from "./listener-tokens"; const listeningOnRequestChannelsInjectable = getInjectable({ id: "listening-on-request-channels", instantiate: (di) => { const enlistRequestChannelListener = di.inject(enlistRequestChannelListenerInjectable); + const enlistRawRequestChannelListener = di.inject(enlistRawRequestChannelListenerInjectable); const requestChannelListeners = di.injectMany(requestChannelListenerInjectionToken); + const rawRequestChannelListeners = di.injectMany(rawRequestChannelListenerInjectionToken); return getStartableStoppable("listening-on-request-channels", () => { const seenChannels = new Set>(); - for (const listener of requestChannelListeners) { + for (const listener of [...requestChannelListeners, ...rawRequestChannelListeners]) { if (seenChannels.has(listener.channel)) { throw new Error(`Tried to register a multiple channel handlers for "${listener.channel.id}", only one handler is supported for a request channel.`); } @@ -26,7 +29,10 @@ const listeningOnRequestChannelsInjectable = getInjectable({ seenChannels.add(listener.channel); } - return disposer(requestChannelListeners.map(enlistRequestChannelListener)); + return disposer( + requestChannelListeners.map(enlistRequestChannelListener), + rawRequestChannelListeners.map(enlistRawRequestChannelListener), + ); }); }, }); diff --git a/packages/core/src/renderer/frames/cluster-frame/init-cluster-frame.injectable.ts b/packages/core/src/renderer/frames/cluster-frame/init-cluster-frame.injectable.ts index 2aa2635a50..54c97393e6 100644 --- a/packages/core/src/renderer/frames/cluster-frame/init-cluster-frame.injectable.ts +++ b/packages/core/src/renderer/frames/cluster-frame/init-cluster-frame.injectable.ts @@ -12,7 +12,7 @@ import showErrorNotificationInjectable from "../../components/notifications/show import autoInitExtensionsInjectable from "../../../features/extensions/loader/common/auto-init-extensions.injectable"; import prefixedLoggerInjectable from "../../../common/logger/prefixed-logger.injectable"; import { when } from "mobx"; -import { requestSetClusterFrameId } from "../../ipc"; +import requestSetClusterFrameIdInjectable from "../../../features/cluster/frame-id/renderer/request-set-frame-id.injectable"; const initClusterFrameInjectable = getInjectable({ id: "init-cluster-frame", @@ -28,6 +28,7 @@ const initClusterFrameInjectable = getInjectable({ const emitAppEvent = di.inject(emitAppEventInjectable); const logger = di.inject(prefixedLoggerInjectable, "CLUSTER-FRAME"); const showErrorNotification = di.inject(showErrorNotificationInjectable); + const requestSetClusterFrameId = di.inject(requestSetClusterFrameIdInjectable); return async (unmountRoot: () => void) => { // TODO: Make catalogEntityRegistry already initialized when passed as dependency diff --git a/packages/core/src/renderer/ipc/index.ts b/packages/core/src/renderer/ipc/index.ts index 5cc4c245c2..014481ba29 100644 --- a/packages/core/src/renderer/ipc/index.ts +++ b/packages/core/src/renderer/ipc/index.ts @@ -3,7 +3,7 @@ * Licensed under MIT License. See LICENSE in root directory for more information. */ -import { clusterActivateHandler, clusterDisconnectHandler, clusterSetFrameIdHandler, clusterStates } from "../../common/ipc/cluster"; +import { clusterActivateHandler, clusterDisconnectHandler, clusterStates } from "../../common/ipc/cluster"; import type { ClusterId, ClusterState } from "../../common/cluster-types"; import { windowActionHandleChannel, windowLocationChangedChannel, windowOpenAppMenuAsContextMenuChannel, type WindowAction } from "../../common/ipc/window"; import { toJS } from "../utils"; @@ -39,10 +39,6 @@ export function requestWindowAction(type: WindowAction): Promise { return requestMain(windowActionHandleChannel, type); } -export function requestSetClusterFrameId(clusterId: ClusterId): Promise { - return requestMain(clusterSetFrameIdHandler, clusterId); -} - export function requestClusterActivation(clusterId: ClusterId, force?: boolean): Promise { return requestMain(clusterActivateHandler, clusterId, force); }