Skip to content

Commit

Permalink
skipJob bug
Browse files Browse the repository at this point in the history
  • Loading branch information
ceddybi committed Feb 21, 2024
1 parent d3942a6 commit 73401ba
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
{
"name": "aij",
"productName": "AIJ",
"version": "0.1.6",
"version": "0.1.7",
"description": "AI Jobs",
"main": ".webpack/main",
"homepage": "https://algojobs.ca",
"scripts": {
"dev": "APP_DEV=true yarn start",
"start": "electron-forge start",
"package": "electron-forge package",
"make": "electron-forge make --arch=x64 --platform",
Expand Down
11 changes: 5 additions & 6 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -259,16 +259,15 @@ ipcMain.handle('app:skip', async (event, app: Application) => {

ipcMain.handle('app:complete', async (event, app: Application) => {
if (!app) return;
const jobId = _get(app, "job.id", "");
const newState = await addApplied(app.job);
const completedApps = newState.completedApps || [];
newState.skippedApps = (newState.skippedApps || []).filter((a) => a.job?.id !== app.job?.id);
if (!(newState.completedApps || []).includes(app)) {
newState.completedApps = [...(newState.completedApps || []), app];
}
if (!completedApps.some((a) => a.job?.id === jobId)) {
newState.completedApps = [...(completedApps), app];
};
await setState(newState);

const jobId = _get(app, "job.id", "");
appEvents.emit(APPEVENTS.APP_STOP, jobId);

return newState;
});

Expand Down

0 comments on commit 73401ba

Please sign in to comment.