mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
cluster-view battling -- part 3
Signed-off-by: Roman <ixrock@gmail.com> Signed-off-by: Lauri Nevala <lauri.nevala@gmail.com>
This commit is contained in:
1 parent
09c765cab0
commit
2287332f8b
7 files changed
+11
-23
No files matched your search
@@ -3,14 +3,6 @@ import { ClusterId, clusterStore } from "./cluster-store";
|
||||
import { tracker } from "./tracker";
|
||||
|
||||
export const clusterIpc = {
|
||||
// todo: remove
|
||||
init: createIpcChannel({
|
||||
channel: "cluster:init",
|
||||
handle: async (clusterId: ClusterId) => {
|
||||
return clusterStore.getById(clusterId)?.pushState();
|
||||
},
|
||||
}),
|
||||
|
||||
activate: createIpcChannel({
|
||||
channel: "cluster:activate",
|
||||
handle: async (clusterId: ClusterId = clusterStore.activeClusterId) => {
|
||||
|
||||
@@ -64,7 +64,7 @@ export class ClusterStore extends BaseStore<ClusterStoreModel> {
|
||||
if (ipcRenderer) {
|
||||
ipcRenderer.on("cluster:state", (event, clusterState: ClusterState) => {
|
||||
this.applyWithoutSync(() => {
|
||||
logger.debug(`[CLUSTER-STORE]: received state update for cluster=${clusterState.id}`, clusterState);
|
||||
logger.info(`[CLUSTER-STORE]: received state update for cluster=${clusterState.id}`, clusterState);
|
||||
const cluster = this.getById(clusterState.id);
|
||||
if (cluster) cluster.updateModel(clusterState)
|
||||
})
|
||||
|
||||
+1
-1
@@ -33,7 +33,7 @@ export interface IpcChannelInit {
|
||||
once?: boolean; // todo: add support
|
||||
}
|
||||
|
||||
export function createIpcChannel({ autoBind = false, mode = IpcMode.ASYNC, timeout = 0, handle, channel }: IpcChannelInit) {
|
||||
export function createIpcChannel({ autoBind = true, mode = IpcMode.ASYNC, timeout = 0, handle, channel }: IpcChannelInit) {
|
||||
channel = `${mode}:${channel}`
|
||||
|
||||
const ipcChannel = {
|
||||
|
||||
Reference in new issue
Block a user