Switch to using messaging from the Feature

Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
This commit is contained in:
Janne Savolainen committed 2023-03-21 09:28:19 +02:00
1 parent 11fc55bf8e
commit d6017bbe27
106 files changed
+266 -270

No files matched your search

@@ -4,7 +4,7 @@
*/
import type { OpenDialogOptions } from "electron";
import type { RequestChannel } from "../../../common/utils/channel/request-channel-listener-injection-token";
import type { RequestChannel } from "@k8slens/messaging";
export type PathPickingResponse = {
canceled: true;
@@ -4,12 +4,13 @@
*/
import askUserForFilePathsInjectable from "../../../main/ipc/ask-user-for-file-paths.injectable";
import { getRequestChannelListenerInjectable } from "../../../main/utils/channel/channel-listeners/listener-tokens";
import { getRequestChannelListenerInjectable } from "@k8slens/messaging";
import { openPathPickingDialogChannel } from "../common/channel";
const openPathPickingDialogListener = getRequestChannelListenerInjectable({
id: 'open-path-picking-dialog',
channel: openPathPickingDialogChannel,
handler: (di) => di.inject(askUserForFilePathsInjectable),
getHandler: (di) => di.inject(askUserForFilePathsInjectable),
});
export default openPathPickingDialogListener;
@@ -4,7 +4,7 @@
*/
import { getInjectable } from "@ogre-tools/injectable";
import type { PathPickOpts } from "../../../renderer/components/path-picker";
import requestFromChannelInjectable from "../../../renderer/utils/channel/request-from-channel.injectable";
import { requestFromChannelInjectionToken } from "@k8slens/messaging";
import { openPathPickingDialogChannel } from "../common/channel";
export type OpenPathPickingDialog = (options: PathPickOpts) => Promise<void>;
@@ -12,7 +12,7 @@ export type OpenPathPickingDialog = (options: PathPickOpts) => Promise<void>;
const openPathPickingDialogInjectable = getInjectable({
id: "open-path-picking-dialog",
instantiate: (di): OpenPathPickingDialog => {
const requestFromChannel = di.inject(requestFromChannelInjectable);
const requestFromChannel = di.inject(requestFromChannelInjectionToken);
return async (options) => {
const { onPick, onCancel, ...dialogOptions } = options;