diff --git a/apps/desktop/src/hooks/useRecording.ts b/apps/desktop/src/hooks/useRecording.ts index c2242ac..b45b00d 100644 --- a/apps/desktop/src/hooks/useRecording.ts +++ b/apps/desktop/src/hooks/useRecording.ts @@ -63,13 +63,7 @@ export const useRecording = ({ try { // Request main process to start recording - const state = await startRecordingMutation(); - - // If main process failed to start, abort - if (state !== "recording" && state !== "starting") { - console.error("Hook: Main process failed to start recording", state); - return; - } + await startRecordingMutation(); // Call start callback if provided if (onRecordingStartCallback) { diff --git a/apps/desktop/src/hooks/useRecordingState.ts b/apps/desktop/src/hooks/useRecordingState.ts index f86e7fa..bbddca7 100644 --- a/apps/desktop/src/hooks/useRecordingState.ts +++ b/apps/desktop/src/hooks/useRecordingState.ts @@ -4,8 +4,8 @@ import type { RecordingState } from "@/types/recording"; export interface UseRecordingStateOutput { recordingState: RecordingState; - startRecording: () => Promise; - stopRecording: () => Promise; + startRecording: () => Promise; + stopRecording: () => Promise; } export const useRecordingState = (): UseRecordingStateOutput => { @@ -27,20 +27,18 @@ export const useRecordingState = (): UseRecordingStateOutput => { }, }); - const startRecording = async (): Promise => { + const startRecording = async (): Promise => { try { - const status = await startRecordingMutation.mutateAsync(); - return status; + await startRecordingMutation.mutateAsync(); } catch (error) { console.error("Failed to start recording via tRPC", error); throw error; } }; - const stopRecording = async (): Promise => { + const stopRecording = async (): Promise => { try { - const status = await stopRecordingMutation.mutateAsync(); - return status; + await stopRecordingMutation.mutateAsync(); } catch (error) { console.error("Failed to stop recording via tRPC", error); throw error; diff --git a/apps/desktop/src/main/core/window-manager.ts b/apps/desktop/src/main/core/window-manager.ts index 5388516..39e644b 100644 --- a/apps/desktop/src/main/core/window-manager.ts +++ b/apps/desktop/src/main/core/window-manager.ts @@ -23,7 +23,7 @@ export class WindowManager { this.mainWindow = new BrowserWindow({ width: 1200, height: 800, - frame: false, + frame: true, titleBarStyle: "hidden", trafficLightPosition: { x: 20, y: 16 }, useContentSize: true, diff --git a/apps/desktop/src/trpc/routers/recording.ts b/apps/desktop/src/trpc/routers/recording.ts index a2f45c2..aea318e 100644 --- a/apps/desktop/src/trpc/routers/recording.ts +++ b/apps/desktop/src/trpc/routers/recording.ts @@ -2,7 +2,7 @@ import { initTRPC } from "@trpc/server"; import { observable } from "@trpc/server/observable"; import superjson from "superjson"; import { ServiceManager } from "../../main/managers/service-manager"; -import type { RecordingStatus } from "../../types/recording"; +import type { RecordingState } from "../../types/recording"; import { logger } from "../../main/logger"; const t = initTRPC.create({ @@ -38,7 +38,7 @@ export const recordingRouter = t.router({ // TODO: Remove this workaround when electron-trpc is updated to handle native Symbol.asyncDispose // eslint-disable-next-line deprecation/deprecation stateUpdates: t.procedure.subscription(() => { - return observable((emit) => { + return observable((emit) => { const serviceManager = ServiceManager.getInstance(); if (!serviceManager) { throw new Error("ServiceManager not initialized"); @@ -50,7 +50,7 @@ export const recordingRouter = t.router({ emit.next(recordingManager.getState()); // Set up listener for state changes - const handleStateChange = (status: RecordingStatus) => { + const handleStateChange = (status: RecordingState) => { emit.next(status); };