diff --git a/.gitignore b/.gitignore index 526ac9cb8..3665d8e79 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ # Dependencies /node_modules +Brewfile.lock.json /.pnp .pnp.js Brewfile.lock.json diff --git a/package.json b/package.json index 3b0617369..3b04b376b 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "electron-squirrel-startup": "^1.0.0", "event-marker": "git+https://github.com/brown-ccv/event-marker.git", "execa": "^5.0.0", - "firebase": "^9.8.4", + "firebase": "^10.1.0", "fs-extra": "^8.1.0", "jquery": "^3.4.1", "jspsych": "^7.2.3", @@ -50,10 +50,10 @@ "dotenv-cli": "^7.0.0", "electron": "19.0.8", "eslint": "^8.38.0", - "eslint-config-prettier": "^8.8.0", + "eslint-config-prettier": "^9.0.0", "eslint-plugin-prettier": "^5.0.0", "firebase-admin": "^11.0.1", - "firebase-tools": "^11.0.1", + "firebase-tools": "^12.4.7", "husky": "^8.0.3", "lint-staged": "^13.2.0", "require-context.macro": "^1.1.1", @@ -75,7 +75,7 @@ "start": "cross-env BROWSER=\"none\" NODE_PATH=\"./src\" IMAGE_INLINE_SIZE_LIMIT=0 react-scripts start", "start:browser": "cross-env IMAGE_INLINE_SIZE_LIMIT=0 react-scripts start", "electron": "electron .", - "electron-dev": "wait-on http://localhost:3000 && cross-env ELECTRON_START_URL=\"http://localhost:3000\" electron .", + "electron-dev": "wait-on http://127.0.0.1:3000 && cross-env ELECTRON_START_URL=\"http://127.0.0.1:3000\" electron .", "dev": "concurrently -k npm:start npm:electron-dev", "dev:firebase": "dotenv -e env/.env.firebase npm run start:browser", "dev:home": "dotenv -e env/.env.home npm run dev", diff --git a/public/electron.js b/public/electron.js index 6afde9049..c291fef92 100644 --- a/public/electron.js +++ b/public/electron.js @@ -339,9 +339,14 @@ app.on('will-quit', () => { stream = false; // copy file to config location - fs.mkdir(savePath, { recursive: true }, (err) => { - log.error(err); - fs.copyFileSync(preSavePath, getFullPath(`pid_${participantID}_${today.getTime()}.json`)); - }); + const fullPath = getFullPath(`pid_${participantID}_${today.getTime()}.json`); + try { + fs.mkdirSync(savePath, { recursive: true }); + fs.copyFileSync(preSavePath, fullPath); + } catch (e) { + console.error('Unable to save file: ', fullPath); + console.error(e); + log.error(e); + } } });