chore: enable frame for main window
This commit is contained in:
parent
4d0b3afd71
commit
07a66fcd13
4 changed files with 11 additions and 19 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -4,8 +4,8 @@ import type { RecordingState } from "@/types/recording";
|
|||
|
||||
export interface UseRecordingStateOutput {
|
||||
recordingState: RecordingState;
|
||||
startRecording: () => Promise<RecordingState>;
|
||||
stopRecording: () => Promise<RecordingState>;
|
||||
startRecording: () => Promise<void>;
|
||||
stopRecording: () => Promise<void>;
|
||||
}
|
||||
|
||||
export const useRecordingState = (): UseRecordingStateOutput => {
|
||||
|
|
@ -27,20 +27,18 @@ export const useRecordingState = (): UseRecordingStateOutput => {
|
|||
},
|
||||
});
|
||||
|
||||
const startRecording = async (): Promise<RecordingState> => {
|
||||
const startRecording = async (): Promise<void> => {
|
||||
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<RecordingState> => {
|
||||
const stopRecording = async (): Promise<void> => {
|
||||
try {
|
||||
const status = await stopRecordingMutation.mutateAsync();
|
||||
return status;
|
||||
await stopRecordingMutation.mutateAsync();
|
||||
} catch (error) {
|
||||
console.error("Failed to stop recording via tRPC", error);
|
||||
throw error;
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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<RecordingStatus>((emit) => {
|
||||
return observable<RecordingState>((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);
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue