From ca5a67879311dd646b72a34db9090308c44fb811 Mon Sep 17 00:00:00 2001 From: Mikael Finstad Date: Wed, 9 Oct 2024 11:40:29 +0000 Subject: [PATCH] warn when falling back to default template #2188 --- src/renderer/src/App.tsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/renderer/src/App.tsx b/src/renderer/src/App.tsx index 28eb541b..13e1aa1e 100644 --- a/src/renderer/src/App.tsx +++ b/src/renderer/src/App.tsx @@ -999,9 +999,13 @@ function App() { console.log('outSegTemplateOrDefault', outSegTemplateOrDefault); + const notices: string[] = []; + const warnings: string[] = []; + const { fileNames: outSegFileNames, problems: outSegProblems } = await generateOutSegFileNames({ segments: segmentsToExport, template: outSegTemplateOrDefault }); if (outSegProblems.error != null) { console.warn('Output segments file name invalid, using default instead', outSegFileNames); + warnings.push(t('Fell back to default output file name'), outSegProblems.error); } // throw (() => { const err = new Error('test'); err.code = 'ENOENT'; return err; })(); @@ -1044,6 +1048,7 @@ function App() { const { fileNames, problems } = await generateMergedFileNames({ template: mergedFileTemplateOrDefault }); if (problems.error != null) { console.warn('Merged file name invalid, using default instead', fileNames[0]); + warnings.push(t('Fell back to default output file name'), problems.error); } const [fileName] = fileNames; @@ -1065,9 +1070,6 @@ function App() { }); } - const notices = []; - const warnings = []; - if (!enableOverwriteOutput) warnings.push(i18n.t('Overwrite output setting is disabled and some files might have been skipped.')); if (!exportConfirmEnabled) notices.push(i18n.t('Export options are not shown. You can enable export options by clicking the icon right next to the export button.'));