Added vehicle groups and age calculations.

This commit is contained in:
Patrick Fic
2020-10-16 11:51:53 -07:00
parent 827243e11f
commit 4582bd0f4d
70 changed files with 1793 additions and 213 deletions

View File

@@ -11,7 +11,7 @@ const {
var watcher;
function StartWatcher() {
async function StartWatcher() {
const filePaths =
store.get("filePaths").map((fp) => path.join(fp, "**.[eE][nN][vV]")) || [];
console.log("StartWatcher -> filePaths", filePaths);
@@ -26,8 +26,10 @@ function StartWatcher() {
if (watcher) {
try {
console.log("Trying to close watcher - it already existed.");
watcher.close().then();
console.log("Trying to close watcher - it already existed.111");
await watcher.close();
console.log("Watcher closed successfully!");
} catch (error) {
console.log("Error trying to close Watcher.", error);
}
@@ -71,6 +73,7 @@ function StartWatcher() {
// This event should be triggered everytime something happens.
// console.log("Raw event info:", event, path, details);
});
return filePaths;
}
@@ -107,13 +110,21 @@ async function HandleNewFile(path) {
result[key.toLowerCase()] = val;
});
b.webContents.send(
ipcTypes.default.estimate.toRenderer.estimateDecodeSuccess,
newJobLow
);
if (newJobLow && newJob) {
b.webContents.send(
ipcTypes.default.estimate.toRenderer.estimateDecodeSuccess,
newJobLow
);
NewNotification({
title: "Job Uploaded",
body: "A new job has been uploaded.",
}).show();
NewNotification({
title: "Job Uploaded",
body: "A new job has been uploaded.",
}).show();
} else {
NewNotification({
title: "Job Ignored",
body:
"The job was not uploaded because it does not meet RPS requirements.",
}).show();
}
}