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:
Roman authored and Lauri Nevala committed 2020-08-18 11:50:54 +03:00
1 parent 09c765cab0
commit 2287332f8b
7 files changed
+11 -23

No files matched your search

-8
View File
@@ -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) => {
+1 -1
View File
@@ -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
View File
@@ -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 = {