mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Simplify more and more naming
Co-authored-by: Janne Savolainen <janne.savolainen@live.fi> Signed-off-by: Iku-turso <mikko.aspiala@gmail.com>
This commit is contained in:
parent
3e5f374122
commit
d463fe2b4b
@ -48,7 +48,7 @@ import type { TrayMenuItem } from "../../../main/tray/tray-menu-item/tray-menu-i
|
|||||||
import electronTrayInjectable from "../../../main/tray/electron-tray/electron-tray.injectable";
|
import electronTrayInjectable from "../../../main/tray/electron-tray/electron-tray.injectable";
|
||||||
import applicationWindowInjectable from "../../../main/start-main-application/lens-window/application-window/application-window.injectable";
|
import applicationWindowInjectable from "../../../main/start-main-application/lens-window/application-window/application-window.injectable";
|
||||||
import { Notifications } from "../notifications/notifications";
|
import { Notifications } from "../notifications/notifications";
|
||||||
import notifyThatRootFrameIsRenderedInjectable from "../../frames/root-frame/notify-that-root-frame-is-rendered.injectable";
|
import broadcastThatRootFrameIsRenderedInjectable from "../../frames/root-frame/broadcast-that-root-frame-is-rendered.injectable";
|
||||||
|
|
||||||
type Callback = (dis: DiContainers) => void | Promise<void>;
|
type Callback = (dis: DiContainers) => void | Promise<void>;
|
||||||
|
|
||||||
@ -122,7 +122,7 @@ export const getApplicationBuilder = () => {
|
|||||||
renderSidebar: () => null,
|
renderSidebar: () => null,
|
||||||
|
|
||||||
beforeRender: () => {
|
beforeRender: () => {
|
||||||
const nofifyThatRootFrameIsRendered = rendererDi.inject(notifyThatRootFrameIsRenderedInjectable);
|
const nofifyThatRootFrameIsRendered = rendererDi.inject(broadcastThatRootFrameIsRenderedInjectable);
|
||||||
|
|
||||||
nofifyThatRootFrameIsRendered();
|
nofifyThatRootFrameIsRendered();
|
||||||
},
|
},
|
||||||
|
|||||||
@ -0,0 +1,22 @@
|
|||||||
|
/**
|
||||||
|
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||||
|
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||||
|
*/
|
||||||
|
import { getInjectable } from "@ogre-tools/injectable";
|
||||||
|
import { sendToChannelInjectionToken } from "../../../common/channel/send-to-channel-injection-token";
|
||||||
|
import rootFrameIsRenderedChannelInjectable from "../../../common/root-frame-rendered-channel/root-frame-rendered-channel.injectable";
|
||||||
|
|
||||||
|
const broadcastThatRootFrameIsRenderedInjectable = getInjectable({
|
||||||
|
id: "broadcast-that-root-frame-is-rendered",
|
||||||
|
|
||||||
|
instantiate: (di) => {
|
||||||
|
const sendToChannel = di.inject(sendToChannelInjectionToken);
|
||||||
|
const rootFrameIsRenderedChannel = di.inject(rootFrameIsRenderedChannelInjectable);
|
||||||
|
|
||||||
|
return () => {
|
||||||
|
sendToChannel(rootFrameIsRenderedChannel);
|
||||||
|
};
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
export default broadcastThatRootFrameIsRenderedInjectable;
|
||||||
@ -1,22 +0,0 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
|
||||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
|
||||||
*/
|
|
||||||
import { getInjectable } from "@ogre-tools/injectable";
|
|
||||||
import { sendToChannelInjectionToken } from "../../../common/channel/send-to-channel-injection-token";
|
|
||||||
import rootFrameRenderedChannelInjectable from "../../../common/root-frame-rendered-channel/root-frame-rendered-channel.injectable";
|
|
||||||
|
|
||||||
const notifyThatRootFrameIsRenderedInjectable = getInjectable({
|
|
||||||
id: "notify-that-root-frame-is-rendered",
|
|
||||||
|
|
||||||
instantiate: (di) => {
|
|
||||||
const sendToChannel = di.inject(sendToChannelInjectionToken);
|
|
||||||
const rootFrameRenderedChannel = di.inject(rootFrameRenderedChannelInjectable);
|
|
||||||
|
|
||||||
return () => {
|
|
||||||
sendToChannel(rootFrameRenderedChannel);
|
|
||||||
};
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
export default notifyThatRootFrameIsRenderedInjectable;
|
|
||||||
@ -12,12 +12,12 @@ import { Notifications } from "../../components/notifications";
|
|||||||
import { ConfirmDialog } from "../../components/confirm-dialog";
|
import { ConfirmDialog } from "../../components/confirm-dialog";
|
||||||
import { CommandContainer } from "../../components/command-palette/command-container";
|
import { CommandContainer } from "../../components/command-palette/command-container";
|
||||||
import { withInjectables } from "@ogre-tools/injectable-react";
|
import { withInjectables } from "@ogre-tools/injectable-react";
|
||||||
import notifyThatRootFrameIsRenderedInjectable from "./notify-that-root-frame-is-rendered.injectable";
|
import broadcastThatRootFrameIsRenderedInjectable from "./broadcast-that-root-frame-is-rendered.injectable";
|
||||||
|
|
||||||
injectSystemCAs();
|
injectSystemCAs();
|
||||||
|
|
||||||
interface Dependencies {
|
interface Dependencies {
|
||||||
notifyThatRootFrameIsRendered: () => void;
|
broadcastThatRootFrameIsRendered: () => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
@observer
|
@observer
|
||||||
@ -25,7 +25,7 @@ class NonInjectedRootFrame extends React.Component<Dependencies> {
|
|||||||
static displayName = "RootFrame";
|
static displayName = "RootFrame";
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
this.props.notifyThatRootFrameIsRendered();
|
this.props.broadcastThatRootFrameIsRendered();
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
@ -47,7 +47,7 @@ export const RootFrame = withInjectables<Dependencies>(
|
|||||||
|
|
||||||
{
|
{
|
||||||
getProps: (di, props) => ({
|
getProps: (di, props) => ({
|
||||||
notifyThatRootFrameIsRendered: di.inject(notifyThatRootFrameIsRenderedInjectable),
|
broadcastThatRootFrameIsRendered: di.inject(broadcastThatRootFrameIsRenderedInjectable),
|
||||||
...props,
|
...props,
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user