From 0c802799ff2d9595f9e44314f81c394aca53355e Mon Sep 17 00:00:00 2001 From: Brendan Allan Date: Tue, 14 Jan 2025 18:04:41 +0800 Subject: [PATCH] fix types --- .../(window-chrome)/settings/apps/index.tsx | 4 ++-- apps/desktop/src/routes/editor/Header.tsx | 12 +++--------- apps/desktop/src/routes/recordings-overlay.tsx | 18 +++++++++++------- apps/desktop/src/utils/queries.ts | 6 ++++++ 4 files changed, 22 insertions(+), 18 deletions(-) diff --git a/apps/desktop/src/routes/(window-chrome)/settings/apps/index.tsx b/apps/desktop/src/routes/(window-chrome)/settings/apps/index.tsx index 0505fa56b..62ce1b4f3 100644 --- a/apps/desktop/src/routes/(window-chrome)/settings/apps/index.tsx +++ b/apps/desktop/src/routes/(window-chrome)/settings/apps/index.tsx @@ -11,7 +11,7 @@ export default function AppsTab() { const [isUpgraded] = createResource(checkIsUpgradedAndUpdate); const apps = [ - window.FLAGS.customS3 && { + { name: "S3 Config", description: "Connect your own S3 bucket. All new shareable link uploads will be uploaded here. Maintain complete ownership over your data.", @@ -19,7 +19,7 @@ export default function AppsTab() { url: "/settings/apps/s3-config", pro: true, }, - ].filter(Boolean); + ]; const handleAppClick = async (app: (typeof apps)[number]) => { if (app.pro && !isUpgraded()) { diff --git a/apps/desktop/src/routes/editor/Header.tsx b/apps/desktop/src/routes/editor/Header.tsx index d763413f7..bff460dd5 100644 --- a/apps/desktop/src/routes/editor/Header.tsx +++ b/apps/desktop/src/routes/editor/Header.tsx @@ -15,7 +15,7 @@ import { Tooltip } from "@kobalte/core"; import { type RenderProgress, commands } from "~/utils/tauri"; -import { useEditorContext } from "./context"; +import { FPS, useEditorContext } from "./context"; import { Dialog, DialogContent } from "./ui"; import { type ProgressState, @@ -304,7 +304,7 @@ function ExportButton() { project, progress, true, - useCustomMuxer + FPS ); await commands.copyFileToPath(videoPath, path); @@ -442,13 +442,7 @@ function ShareButton() { getRequestEvent()?.nativeEvent; - await commands.exportVideo( - videoId, - projectConfig, - progress, - true, - false - ); + await commands.exportVideo(videoId, projectConfig, progress, true, FPS); // Now proceed with upload const result = recordingMeta()?.sharing diff --git a/apps/desktop/src/routes/recordings-overlay.tsx b/apps/desktop/src/routes/recordings-overlay.tsx index 83a1d6364..2962b7a0d 100644 --- a/apps/desktop/src/routes/recordings-overlay.tsx +++ b/apps/desktop/src/routes/recordings-overlay.tsx @@ -35,6 +35,7 @@ import { DEFAULT_PROJECT_CONFIG } from "./editor/projectConfig"; import { createPresets } from "~/utils/createPresets"; import { progressState, setProgressState } from "~/store/progress"; import { checkIsUpgradedAndUpdate } from "~/utils/plans"; +import { FPS } from "./editor/context"; type MediaEntry = { path: string; @@ -383,17 +384,20 @@ export default function () { ), 100 ); - + // If we hit 100%, transition to the next stage - if (progress === 100 && progressState.type === "uploading") { + if ( + progress === 100 && + progressState.type === "uploading" + ) { setProgressState({ ...progressState, stage: "uploading", message: "Starting upload...", - uploadProgress: 0 + uploadProgress: 0, }); } - + return `${progress}%`; } @@ -772,7 +776,7 @@ function createRecordingMutations( presets.getDefaultConfig() ?? DEFAULT_PROJECT_CONFIG, progress, false, - useCustomMuxer + FPS ); // Show quick progress animation for existing video @@ -897,7 +901,7 @@ function createRecordingMutations( presets.getDefaultConfig() ?? DEFAULT_PROJECT_CONFIG, progress, true, // Force re-render - false + FPS ); await commands.copyFileToPath(outputPath, savePath); @@ -1027,7 +1031,7 @@ function createRecordingMutations( presets.getDefaultConfig() ?? DEFAULT_PROJECT_CONFIG, progress, false, - useCustomMuxer + FPS ); console.log("Using existing rendered video"); diff --git a/apps/desktop/src/utils/queries.ts b/apps/desktop/src/utils/queries.ts index 72a346f61..e016ad50f 100644 --- a/apps/desktop/src/utils/queries.ts +++ b/apps/desktop/src/utils/queries.ts @@ -9,6 +9,7 @@ import { createQueryInvalidate } from "./events"; import { createStore, reconcile } from "solid-js/store"; import { createEffect, createMemo } from "solid-js"; import { makePersisted } from "@solid-primitives/storage"; +import { FPS } from "~/routes/editor/context"; export const listWindows = queryOptions({ queryKey: ["capture", "windows"] as const, @@ -76,6 +77,11 @@ export function createOptionsQuery() { createStore({ cameraLabel: null, audioInputName: null, + fps: FPS, + outputResolution: { + width: 1920, + height: 1080, + }, }), { name: "recordingOptionsQuery" } );