Merge pull request #62 from mifi/master

[pull] master from mifi:master
pull[bot] 1 year ago committed by GitHub
commit 21aaead7d3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -790,6 +790,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;
@ -797,7 +799,7 @@ export async function askForPlaybackRate({ detectedFps, outputPlaybackRate }: {
return undefined;
}
const { value } = await Swal.fire({
const { value, isConfirmed } = await Swal.fire<string>({
title: i18n.t('Change FPS'),
input: 'text',
inputValue: currentFps.toFixed(5),
@ -810,7 +812,7 @@ export async function askForPlaybackRate({ detectedFps, outputPlaybackRate }: {
},
});
if (!value) return undefined;
if (!isConfirmed || value == null) return undefined;
return parseValue(value);
}

Loading…
Cancel
Save