diff --git a/src/renderer/components/test-utils/get-application-builder.tsx b/src/renderer/components/test-utils/get-application-builder.tsx index 4ac51dc4f6..33afbf8a88 100644 --- a/src/renderer/components/test-utils/get-application-builder.tsx +++ b/src/renderer/components/test-utils/get-application-builder.tsx @@ -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 applicationWindowInjectable from "../../../main/start-main-application/lens-window/application-window/application-window.injectable"; 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; @@ -122,7 +122,7 @@ export const getApplicationBuilder = () => { renderSidebar: () => null, beforeRender: () => { - const nofifyThatRootFrameIsRendered = rendererDi.inject(notifyThatRootFrameIsRenderedInjectable); + const nofifyThatRootFrameIsRendered = rendererDi.inject(broadcastThatRootFrameIsRenderedInjectable); nofifyThatRootFrameIsRendered(); }, diff --git a/src/renderer/frames/root-frame/broadcast-that-root-frame-is-rendered.injectable.ts b/src/renderer/frames/root-frame/broadcast-that-root-frame-is-rendered.injectable.ts new file mode 100644 index 0000000000..aafabb31d3 --- /dev/null +++ b/src/renderer/frames/root-frame/broadcast-that-root-frame-is-rendered.injectable.ts @@ -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; diff --git a/src/renderer/frames/root-frame/notify-that-root-frame-is-rendered.injectable.ts b/src/renderer/frames/root-frame/notify-that-root-frame-is-rendered.injectable.ts deleted file mode 100644 index ab36faf4a6..0000000000 --- a/src/renderer/frames/root-frame/notify-that-root-frame-is-rendered.injectable.ts +++ /dev/null @@ -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; diff --git a/src/renderer/frames/root-frame/root-frame.tsx b/src/renderer/frames/root-frame/root-frame.tsx index 415a130e90..834dd63855 100644 --- a/src/renderer/frames/root-frame/root-frame.tsx +++ b/src/renderer/frames/root-frame/root-frame.tsx @@ -12,12 +12,12 @@ import { Notifications } from "../../components/notifications"; import { ConfirmDialog } from "../../components/confirm-dialog"; import { CommandContainer } from "../../components/command-palette/command-container"; 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(); interface Dependencies { - notifyThatRootFrameIsRendered: () => void; + broadcastThatRootFrameIsRendered: () => void; } @observer @@ -25,7 +25,7 @@ class NonInjectedRootFrame extends React.Component { static displayName = "RootFrame"; componentDidMount() { - this.props.notifyThatRootFrameIsRendered(); + this.props.broadcastThatRootFrameIsRendered(); } render() { @@ -47,7 +47,7 @@ export const RootFrame = withInjectables( { getProps: (di, props) => ({ - notifyThatRootFrameIsRendered: di.inject(notifyThatRootFrameIsRenderedInjectable), + broadcastThatRootFrameIsRendered: di.inject(broadcastThatRootFrameIsRenderedInjectable), ...props, }), },