Skip to content

Commit

Permalink
fix types
Browse files Browse the repository at this point in the history
  • Loading branch information
Brendonovich committed Jan 14, 2025
1 parent efa3cfc commit 0c80279
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ 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.",
icon: IconLucideDatabase,
url: "/settings/apps/s3-config",
pro: true,
},
].filter(Boolean);
];

const handleAppClick = async (app: (typeof apps)[number]) => {
if (app.pro && !isUpgraded()) {
Expand Down
12 changes: 3 additions & 9 deletions apps/desktop/src/routes/editor/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -304,7 +304,7 @@ function ExportButton() {
project,
progress,
true,
useCustomMuxer
FPS
);
await commands.copyFileToPath(videoPath, path);

Expand Down Expand Up @@ -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
Expand Down
18 changes: 11 additions & 7 deletions apps/desktop/src/routes/recordings-overlay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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}%`;
}

Expand Down Expand Up @@ -772,7 +776,7 @@ function createRecordingMutations(
presets.getDefaultConfig() ?? DEFAULT_PROJECT_CONFIG,
progress,
false,
useCustomMuxer
FPS
);

// Show quick progress animation for existing video
Expand Down Expand Up @@ -897,7 +901,7 @@ function createRecordingMutations(
presets.getDefaultConfig() ?? DEFAULT_PROJECT_CONFIG,
progress,
true, // Force re-render
false
FPS
);

await commands.copyFileToPath(outputPath, savePath);
Expand Down Expand Up @@ -1027,7 +1031,7 @@ function createRecordingMutations(
presets.getDefaultConfig() ?? DEFAULT_PROJECT_CONFIG,
progress,
false,
useCustomMuxer
FPS
);
console.log("Using existing rendered video");

Expand Down
6 changes: 6 additions & 0 deletions apps/desktop/src/utils/queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -76,6 +77,11 @@ export function createOptionsQuery() {
createStore<PartialRecordingOptions>({
cameraLabel: null,
audioInputName: null,
fps: FPS,
outputResolution: {
width: 1920,
height: 1080,
},
}),
{ name: "recordingOptionsQuery" }
);
Expand Down

1 comment on commit 0c80279

@vercel
Copy link

@vercel vercel bot commented on 0c80279 Jan 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.