Skip to content

Commit

Permalink
Initialise date object for timeOfScan (#100)
Browse files Browse the repository at this point in the history
* initialise date object for timeOfScan

* bump version number
  • Loading branch information
joshualai9922 authored May 13, 2024
1 parent 360417e commit 11c35bc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "purplea11ydesktop",
"productName": "Purple A11y",
"version": "0.9.51",
"version": "0.9.52",
"private": true,
"dependencies": {
"axios": "^1.6.0",
Expand Down
3 changes: 2 additions & 1 deletion public/electron/scanManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -646,7 +646,7 @@ const init = (scanEvent) => {
return uploadFolderPath;
})

ipcMain.handle("getErrorLog", async (event, timeOfScan, timeOfError) => {
ipcMain.handle("getErrorLog", async (event, timeOfScanString, timeOfError) => {
const errorLogPath = path.join(appPath, 'errors.txt');
const errorLog = fs.readFileSync(errorLogPath, 'utf-8');
const regex = /{.*?}/gs;
Expand Down Expand Up @@ -674,6 +674,7 @@ const init = (scanEvent) => {
for (const entry of entries){
const jsonEntry = JSON.parse(entry);
const timeOfEntry = new Date(jsonEntry['timestamp']).getTime();
const timeOfScan = new Date(timeOfScanString);
if (timeOfEntry >= timeOfScan.getTime() && timeOfEntry <= timeOfError.getTime()){
allErrors = allErrors.concat(entry,"\n")
}
Expand Down

0 comments on commit 11c35bc

Please sign in to comment.