mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Random fixes (#727)
* extract missing localizations from last master <- pr-merge Signed-off-by: Roman <ixrock@gmail.com> * fix: prevent app-crash in preferences in case of incorrect http-proxy value Signed-off-by: Roman <ixrock@gmail.com> * fix: don't repeat ipc-sync message to main renderer process/window when sending to frames Signed-off-by: Roman <ixrock@gmail.com>
This commit is contained in:
1 parent
81a0c432c6
commit
6e645eade0
7 files changed
+241
-166
No files matched your search
@@ -132,7 +132,12 @@ export class BaseStore<T = any> extends Singleton {
|
||||
broadcastIpc(msg); // send to all windows (BrowserWindow, webContents)
|
||||
const frames = await this.getSubFrames();
|
||||
frames.forEach(frameId => {
|
||||
broadcastIpc({ frameId, ...msg }); // send to all sub-frames (e.g. cluster-view managed in iframe)
|
||||
// send to all sub-frames (e.g. cluster-view managed in iframe)
|
||||
broadcastIpc({
|
||||
...msg,
|
||||
frameId: frameId,
|
||||
frameOnly: true,
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
+5
-2
@@ -54,12 +54,13 @@ export interface IpcBroadcastParams<A extends any[] = any> {
|
||||
channel: IpcChannel
|
||||
webContentId?: number; // send to single webContents view
|
||||
frameId?: number; // send to inner frame of webContents
|
||||
frameOnly?: boolean; // send message only to view with provided `frameId`
|
||||
filter?: (webContent: WebContents) => boolean
|
||||
timeout?: number; // todo: add support
|
||||
args?: A;
|
||||
}
|
||||
|
||||
export function broadcastIpc({ channel, frameId, webContentId, filter, args = [] }: IpcBroadcastParams) {
|
||||
export function broadcastIpc({ channel, frameId, frameOnly, webContentId, filter, args = [] }: IpcBroadcastParams) {
|
||||
const singleView = webContentId ? webContents.fromId(webContentId) : null;
|
||||
let views = singleView ? [singleView] : webContents.getAllWebContents();
|
||||
if (filter) {
|
||||
@@ -68,7 +69,9 @@ export function broadcastIpc({ channel, frameId, webContentId, filter, args = []
|
||||
views.forEach(webContent => {
|
||||
const type = webContent.getType();
|
||||
logger.debug(`[IPC]: broadcasting "${channel}" to ${type}=${webContent.id}`, { args });
|
||||
webContent.send(channel, ...args);
|
||||
if (!frameOnly) {
|
||||
webContent.send(channel, ...args);
|
||||
}
|
||||
if (frameId) {
|
||||
webContent.sendToFrame(frameId, channel, ...args)
|
||||
}
|
||||
|
||||
@@ -84,11 +84,7 @@ export class KubeAuthProxy {
|
||||
protected async sendIpcLogMessage(res: KubeAuthProxyLog) {
|
||||
const channel = `kube-auth:${this.cluster.id}`
|
||||
logger.info(`[KUBE-AUTH]: out-channel "${channel}"`, { ...res, meta: this.cluster.getMeta() });
|
||||
broadcastIpc({
|
||||
// webContentId: null, // todo: send a message only to single cluster's window
|
||||
channel: channel,
|
||||
args: [res],
|
||||
});
|
||||
broadcastIpc({ channel: channel, args: [res] });
|
||||
}
|
||||
|
||||
public exit() {
|
||||
|
||||
@@ -13,7 +13,6 @@ import { Input } from "../input";
|
||||
import { Checkbox } from "../checkbox";
|
||||
import { Notifications } from "../notifications";
|
||||
import { Badge } from "../badge";
|
||||
import { Spinner } from "../spinner";
|
||||
import { themeStore } from "../../theme.store";
|
||||
import { history } from "../../navigation";
|
||||
import { Tooltip } from "../tooltip";
|
||||
@@ -58,7 +57,7 @@ export class Preferences extends React.Component {
|
||||
this.helmAddedRepos.clear();
|
||||
repos.forEach(repo => this.helmAddedRepos.set(repo.name, repo));
|
||||
} catch (err) {
|
||||
Notifications.error(err);
|
||||
Notifications.error(String(err));
|
||||
}
|
||||
this.helmLoading = false;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user