Restructure function to match convention. Declare all variables in the beginning of the function rather than declaring them throughout. Small edit while I re-read the UI code and build the file sequence feature.

This commit is contained in:
Matt McWilliams 2021-02-22 13:12:27 -05:00
parent 9ab1436d49
commit 338a60f947
3 changed files with 13 additions and 10 deletions

View File

@ -135,6 +135,10 @@ class FilmOut {
] ]
}; };
let files; let files;
let valid = false;
let pathStr;
let displayName;
let ext;
try { try {
files = yield dialog.showOpenDialog(options); files = yield dialog.showOpenDialog(options);
} }
@ -144,10 +148,7 @@ class FilmOut {
} }
if (!files) if (!files)
return false; return false;
let valid = false; pathStr = files.filePaths[0];
let pathStr = files.filePaths[0];
let displayName;
let ext;
if (pathStr && pathStr !== '') { if (pathStr && pathStr !== '') {
ext = path.extname(pathStr.toLowerCase()); ext = path.extname(pathStr.toLowerCase());
valid = this.extensions.indexOf(ext) === -1 ? false : true; valid = this.extensions.indexOf(ext) === -1 ? false : true;

File diff suppressed because one or more lines are too long

View File

@ -138,6 +138,10 @@ class FilmOut {
] ]
}; };
let files : any; let files : any;
let valid : boolean = false;
let pathStr : string;
let displayName : string;
let ext : string;
try { try {
files = await dialog.showOpenDialog(options) files = await dialog.showOpenDialog(options)
@ -147,10 +151,8 @@ class FilmOut {
} }
if (!files) return false; if (!files) return false;
let valid : boolean = false;
let pathStr : string = files.filePaths[0]; pathStr = files.filePaths[0];
let displayName : string;
let ext : string;
if (pathStr && pathStr !== '') { if (pathStr && pathStr !== '') {
ext = path.extname(pathStr.toLowerCase()); ext = path.extname(pathStr.toLowerCase());