mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Move activating cluster into injectable IPC (#7355)
Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
1 parent
121a50ecf3
commit
497f63fde6
12 files changed
+122
-38
No files matched your search
+1
-13
@@ -5,7 +5,7 @@
|
||||
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 { clusterSetFrameIdHandler, 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";
|
||||
@@ -37,18 +37,6 @@ export const setupIpcMainHandlers = ({
|
||||
pushCatalogToRenderer,
|
||||
getClusterConnection,
|
||||
}: Dependencies) => {
|
||||
ipcMainHandle(clusterActivateHandler, async (event, clusterId: ClusterId, force = false) => {
|
||||
const cluster = getClusterById(clusterId);
|
||||
|
||||
if (!cluster) {
|
||||
return;
|
||||
}
|
||||
|
||||
const clusterConnection = getClusterConnection(cluster);
|
||||
|
||||
await clusterConnection.activate(force);
|
||||
});
|
||||
|
||||
ipcMainHandle(clusterSetFrameIdHandler, (event: IpcMainInvokeEvent, clusterId: ClusterId) => {
|
||||
const cluster = getClusterById(clusterId);
|
||||
|
||||
|
||||
Reference in new issue
Block a user