Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions apps/desktop/src-tauri/src/general_settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,8 @@ pub struct GeneralSettingsStore {
pub enable_new_uploader: bool,
#[serde(default = "default_excluded_windows")]
pub excluded_windows: Vec<WindowExclusion>,
#[serde(default)]
pub delete_instant_recordings_after_upload: bool,
}

fn default_enable_native_camera_preview() -> bool {
Expand Down Expand Up @@ -184,6 +186,7 @@ impl Default for GeneralSettingsStore {
post_deletion_behaviour: PostDeletionBehaviour::DoNothing,
enable_new_uploader: default_enable_new_uploader(),
excluded_windows: default_excluded_windows(),
delete_instant_recordings_after_upload: false,
}
}
}
Expand Down
20 changes: 13 additions & 7 deletions apps/desktop/src-tauri/src/recording.rs
Original file line number Diff line number Diff line change
Expand Up @@ -949,7 +949,7 @@ async fn handle_recording_finish(
.map_err(|err|
error!("Error compressing thumbnail for instant mode progressive upload: {err}")
) {
crate::upload::singlepart_uploader(
let res = crate::upload::singlepart_uploader(
app.clone(),
crate::api::PresignedS3PutRequest {
video_id: video_upload_info.id.clone(),
Expand All @@ -959,13 +959,19 @@ async fn handle_recording_finish(
},
bytes.len() as u64,
stream::once(async move { Ok::<_, std::io::Error>(bytes::Bytes::from(bytes)) }),

)
.await
.map_err(|err| {
error!("Error updating thumbnail for instant mode progressive upload: {err}")
})
.ok();
.await;
if let Err(err) = res {
error!("Error updating thumbnail for instant mode progressive upload: {err}");
return;
}

if GeneralSettingsStore::get(&app).ok().flatten().unwrap_or_default().delete_instant_recordings_after_upload {
if let Err(err) = tokio::fs::remove_dir_all(&recording_dir).await {
error!("Failed to remove recording files after upload: {err:?}");
return;
}
}
}
} else if let Ok(meta) = build_video_meta(&output_path)
.map_err(|err| error!("Error getting video metadata: {}", err))
Expand Down
8 changes: 4 additions & 4 deletions apps/desktop/src/routes/(window-chrome)/settings/Setting.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Toggle } from "~/components/Toggle";

export function Setting(props: {
export function SettingItem(props: {
pro?: boolean;
label: string;
description?: string;
Expand All @@ -21,20 +21,20 @@ export function Setting(props: {
);
}

export function ToggleSetting(props: {
export function ToggleSettingItem(props: {
pro?: boolean;
label: string;
description?: string;
value: boolean;
onChange(v: boolean): void;
}) {
return (
<Setting {...props}>
<SettingItem {...props}>
<Toggle
size="sm"
checked={props.value}
onChange={(v) => props.onChange(v)}
/>
</Setting>
</SettingItem>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { createStore } from "solid-js/store";

import { generalSettingsStore } from "~/store";
import type { GeneralSettingsStore } from "~/utils/tauri";
import { ToggleSetting } from "./Setting";
import { ToggleSettingItem } from "./Setting";

export default function ExperimentalSettings() {
const [store] = createResource(() => generalSettingsStore.get());
Expand Down Expand Up @@ -55,23 +55,23 @@ function Inner(props: { initialStore: GeneralSettingsStore | null }) {
<div class="space-y-3">
<h3 class="text-sm text-gray-12 w-fit">Recording Features</h3>
<div class="px-3 rounded-xl border divide-y divide-gray-3 border-gray-3 bg-gray-2">
<ToggleSetting
<ToggleSettingItem
label="Custom cursor capture in Studio Mode"
description="Studio Mode recordings will capture cursor state separately for customisation (size, smoothing) in the editor. Currently experimental as cursor events may not be captured accurately."
value={!!settings.custom_cursor_capture2}
onChange={(value) =>
handleChange("custom_cursor_capture2", value)
}
/>
<ToggleSetting
<ToggleSettingItem
label="Native camera preview"
description="Show the camera preview using a native GPU surface instead of rendering it within the webview. This is not functional on certain Windows systems so your mileage may vary."
value={!!settings.enableNativeCameraPreview}
onChange={(value) =>
handleChange("enableNativeCameraPreview", value)
}
/>
<ToggleSetting
<ToggleSettingItem
label="Auto zoom on clicks"
description="Automatically generate zoom segments around mouse clicks during Studio Mode recordings. This helps highlight important interactions in your recordings."
value={!!settings.autoZoomOnClicks}
Expand All @@ -84,7 +84,7 @@ function Inner(props: { initialStore: GeneralSettingsStore | null }) {
);
}}
/>
<ToggleSetting
<ToggleSettingItem
label="New recording flow"
description="New and improved flow for starting a recording! You may need to restart the app for this to take effect."
value={!!settings.enableNewRecordingFlow}
Expand All @@ -97,7 +97,7 @@ function Inner(props: { initialStore: GeneralSettingsStore | null }) {
);
}}
/>
<ToggleSetting
<ToggleSettingItem
label="New uploader"
description="Improved uploader for faster and more reliable uploads!"
value={!!settings.enableNewUploader}
Expand Down
Loading
Loading