From 2507313b19aa5dd2fae569bc816f0b76700513a6 Mon Sep 17 00:00:00 2001 From: Mikael Finstad Date: Thu, 31 Jul 2025 16:25:53 +0200 Subject: [PATCH] allow resetting FPS by using empty value https://github.com/mifi/lossless-cut/issues/2492#issuecomment-3135980204 --- src/renderer/src/dialogs/index.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/renderer/src/dialogs/index.tsx b/src/renderer/src/dialogs/index.tsx index 64b1bb15..fa759a1d 100644 --- a/src/renderer/src/dialogs/index.tsx +++ b/src/renderer/src/dialogs/index.tsx @@ -789,6 +789,8 @@ export async function askForPlaybackRate({ detectedFps, outputPlaybackRate }: { const currentFps = fps * outputPlaybackRate; function parseValue(v: string) { + if (v.trim() === '') return 1; // default to 1 if empty + const newFps = parseFloat(v); if (!Number.isNaN(newFps)) { return newFps / fps; @@ -796,7 +798,7 @@ export async function askForPlaybackRate({ detectedFps, outputPlaybackRate }: { return undefined; } - const { value } = await Swal.fire({ + const { value, isConfirmed } = await Swal.fire({ title: i18n.t('Change FPS'), input: 'text', inputValue: currentFps.toFixed(5), @@ -809,7 +811,7 @@ export async function askForPlaybackRate({ detectedFps, outputPlaybackRate }: { }, }); - if (!value) return undefined; + if (!isConfirmed || value == null) return undefined; return parseValue(value); }