From bce16eb7b9786a86b79e7a3ef635014725017324 Mon Sep 17 00:00:00 2001 From: Mikael Finstad Date: Fri, 14 Mar 2025 17:06:08 +0800 Subject: [PATCH] fix time input placeholder fixes #2346 --- src/renderer/src/dialogs/index.tsx | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/renderer/src/dialogs/index.tsx b/src/renderer/src/dialogs/index.tsx index ffbb8758..2d21ce57 100644 --- a/src/renderer/src/dialogs/index.tsx +++ b/src/renderer/src/dialogs/index.tsx @@ -185,7 +185,7 @@ export async function showRefuseToOverwrite() { } export async function askForImportChapters() { - const { value } = await Swal.fire({ + const { isConfirmed } = await Swal.fire({ icon: 'question', text: i18n.t('This file has embedded chapters. Do you want to import the chapters as cut-segments?'), showCancelButton: true, @@ -193,7 +193,7 @@ export async function askForImportChapters() { confirmButtonText: i18n.t('Import chapters'), }); - return value; + return isConfirmed; } const maxSegments = 300; @@ -233,10 +233,10 @@ export async function createNumSegments(fileDuration: number) { return edl; } -const exampleDuration = '00:00:05.123'; - export async function askForSegmentDuration({ fileDuration, inputPlaceholder, parseTimecode }: { - fileDuration: number, inputPlaceholder: string, parseTimecode: ParseTimecode, + fileDuration: number, + inputPlaceholder: string, + parseTimecode: ParseTimecode, }) { const { value } = await Swal.fire({ input: 'text', @@ -310,7 +310,10 @@ async function askForSegmentsStartOrEnd(text: string) { return value === 'both' ? ['start', 'end'] as const : [value as 'start' | 'end'] as const; } -export async function askForShiftSegments({ inputPlaceholder, parseTimecode }: { inputPlaceholder: string, parseTimecode: ParseTimecode }) { +export async function askForShiftSegments({ inputPlaceholder, parseTimecode }: { + inputPlaceholder: string, + parseTimecode: ParseTimecode, +}) { function parseValue(value: string) { let parseableValue = value; let sign = 1; @@ -332,7 +335,7 @@ export async function askForShiftSegments({ inputPlaceholder, parseTimecode }: { text: i18n.t('Shift all segments on the timeline by this amount. Negative values will be shifted back, while positive value will be shifted forward in time.'), inputValidator: (v) => { const parsed = parseValue(v); - if (parsed == null) return i18n.t('Please input a valid duration. Example: {{example}}', { example: exampleDuration }); + if (parsed == null) return i18n.t('Please input a valid duration. Example: {{example}}', { example: inputPlaceholder }); return null; }, });