mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
fixes
Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
This commit is contained in:
parent
a0682302eb
commit
614bf4e689
@ -64,7 +64,7 @@ describe("empty config", () => {
|
|||||||
|
|
||||||
it("sets active cluster", () => {
|
it("sets active cluster", () => {
|
||||||
clusterStore.setActive("foo");
|
clusterStore.setActive("foo");
|
||||||
expect(clusterStore.activeCluster.id).toBe("foo");
|
expect(clusterStore.active.id).toBe("foo");
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@ -73,6 +73,10 @@ export class ClusterStore extends BaseStore<ClusterStoreModel> {
|
|||||||
return filePath;
|
return filePath;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@observable activeCluster: ClusterId;
|
||||||
|
@observable removedClusters = observable.map<ClusterId, Cluster>();
|
||||||
|
@observable clusters = observable.map<ClusterId, Cluster>();
|
||||||
|
|
||||||
private constructor() {
|
private constructor() {
|
||||||
super({
|
super({
|
||||||
configName: "lens-cluster-store",
|
configName: "lens-cluster-store",
|
||||||
@ -80,17 +84,18 @@ export class ClusterStore extends BaseStore<ClusterStoreModel> {
|
|||||||
migrations: migrations,
|
migrations: migrations,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
this.pushStateToViewsPeriodically()
|
||||||
|
}
|
||||||
|
|
||||||
|
protected pushStateToViewsPeriodically() {
|
||||||
if (!ipcRenderer) {
|
if (!ipcRenderer) {
|
||||||
|
// This is a bit of a hack, we need to do this because we might loose messages that are sent before a view is ready
|
||||||
setInterval(() => {
|
setInterval(() => {
|
||||||
this.pushState()
|
this.pushState()
|
||||||
}, 5000)
|
}, 5000)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@observable activeCluster: ClusterId;
|
|
||||||
@observable removedClusters = observable.map<ClusterId, Cluster>();
|
|
||||||
@observable clusters = observable.map<ClusterId, Cluster>();
|
|
||||||
|
|
||||||
registerIpcListener() {
|
registerIpcListener() {
|
||||||
logger.info(`[CLUSTER-STORE] start to listen (${webFrame.routingId})`)
|
logger.info(`[CLUSTER-STORE] start to listen (${webFrame.routingId})`)
|
||||||
ipcRenderer.on("cluster:state", (event, clusterId: string, state: ClusterState) => {
|
ipcRenderer.on("cluster:state", (event, clusterId: string, state: ClusterState) => {
|
||||||
|
|||||||
@ -61,9 +61,6 @@ export interface IpcBroadcastParams<A extends any[] = any> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function broadcastIpc({ channel, frameId, frameOnly, webContentId, filter, args = [] }: IpcBroadcastParams) {
|
export function broadcastIpc({ channel, frameId, frameOnly, webContentId, filter, args = [] }: IpcBroadcastParams) {
|
||||||
if (!webContents) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
const singleView = webContentId ? webContents.fromId(webContentId) : null;
|
const singleView = webContentId ? webContents.fromId(webContentId) : null;
|
||||||
let views = singleView ? [singleView] : webContents.getAllWebContents();
|
let views = singleView ? [singleView] : webContents.getAllWebContents();
|
||||||
if (filter) {
|
if (filter) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user