cluster-state serialization fix

Signed-off-by: Roman <ixrock@gmail.com>
This commit is contained in:
Roman committed 2020-07-16 21:11:57 +03:00
1 parent 5b98674d80
commit 3f8fe0fe1b
2 files changed
+6 -3

No files matched your search

+1 -1
View File
@@ -31,7 +31,7 @@ export function sendMessage({ channel, webContentId, filter, args = [] }: IpcMes
}
views.forEach(webContent => {
const type = webContent.getType();
logger.info(`[IPC]: sending message "${channel}" to webContentId(${type})=${webContent.id}`);
logger.info(`[IPC]: sending message "${channel}" to ${type}=${webContent.id}`);
webContent.send(channel, ...[args].flat());
})
}
+5 -2
View File
@@ -312,7 +312,7 @@ export class Cluster implements ClusterModel {
// serializable full-featured state of the cluster
getState(): ClusterState {
return {
const state: ClusterState = {
...this.toJSON(),
apiUrl: this.apiUrl,
online: this.online,
@@ -324,6 +324,9 @@ export class Cluster implements ClusterModel {
isAdmin: this.isAdmin,
features: this.features,
eventCount: this.eventCount,
}
};
return toJS(state, {
recurseEverything: true
})
}
}