| 1 | import { DesktopAppActivationResponse } from "@t3tools/contracts"; |
| 2 | import * as Effect from "effect/Effect"; |
| 3 | import * as Schema from "effect/Schema"; |
| 4 | |
| 5 | import * as DesktopAppActivation from "../../app/DesktopAppActivation.ts"; |
| 6 | import * as IpcChannels from "../channels.ts"; |
| 7 | import * as DesktopIpc from "../DesktopIpc.ts"; |
| 8 | |
| 9 | export const setReady = DesktopIpc.makeIpcMethod({ |
| 10 | channel: IpcChannels.DESKTOP_APP_ACTIVATION_READY_CHANNEL, |
| 11 | payload: Schema.Boolean, |
| 12 | result: Schema.Void, |
| 13 | handler: Effect.fn("desktop.ipc.appActivation.setReady")(function* (ready) { |
| 14 | const activation = yield* DesktopAppActivation.DesktopAppActivation; |
| 15 | yield* activation.setRendererReady(ready); |
| 16 | }), |
| 17 | }); |
| 18 | |
| 19 | export const complete = DesktopIpc.makeIpcMethod({ |
| 20 | channel: IpcChannels.DESKTOP_APP_ACTIVATION_COMPLETE_CHANNEL, |
| 21 | payload: DesktopAppActivationResponse, |
| 22 | result: Schema.Void, |
| 23 | handler: Effect.fn("desktop.ipc.appActivation.complete")(function* (response) { |
| 24 | const activation = yield* DesktopAppActivation.DesktopAppActivation; |
| 25 | yield* activation.complete(response); |
| 26 | }), |
| 27 | }); |