warn when falling back to default template

#2188
pull/2196/head
Mikael Finstad 2024-10-09 11:40:29 +00:00
rodzic ed559691ab
commit ca5a678793
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 25AB36E3E81CBC26
1 zmienionych plików z 5 dodań i 3 usunięć

Wyświetl plik

@ -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.'));