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 valid = false;
let pathStr;
let displayName;
let ext;
try {
files = yield dialog.showOpenDialog(options);
}
@ -144,10 +148,7 @@ class FilmOut {
}
if (!files)
return false;
let valid = false;
let pathStr = files.filePaths[0];
let displayName;
let ext;
pathStr = files.filePaths[0];
if (pathStr && pathStr !== '') {
ext = path.extname(pathStr.toLowerCase());
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 valid : boolean = false;
let pathStr : string;
let displayName : string;
let ext : string;
try {
files = await dialog.showOpenDialog(options)
@ -147,11 +151,9 @@ class FilmOut {
}
if (!files) return false;
let valid : boolean = false;
let pathStr : string = files.filePaths[0];
let displayName : string;
let ext : string;
pathStr = files.filePaths[0];
if (pathStr && pathStr !== '') {
ext = path.extname(pathStr.toLowerCase());
valid = this.extensions.indexOf(ext) === -1 ? false : true;