Skip to content

Commit 2dc3722

Browse files
Fix issues with deploying on windows
1 parent 83ec6da commit 2dc3722

File tree

4 files changed

+403
-35
lines changed

4 files changed

+403
-35
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,5 @@ npm-debug.log*
2222
yarn-debug.log*
2323
yarn-error.log*
2424
Untiltled
25-
out/
25+
out/
26+
dist/

package.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
"version": "0.1.0",
44
"private": true,
55
"main": "public/main.js",
6+
"build": {
7+
"extraMetadata": {
8+
"main": "build/main.js"
9+
}
10+
},
611
"dependencies": {
712
"@testing-library/jest-dom": "^5.16.2",
813
"@testing-library/react": "^12.1.4",
@@ -50,6 +55,7 @@
5055
"@electron-forge/maker-rpm": "^6.0.1",
5156
"@electron-forge/maker-squirrel": "^6.0.1",
5257
"@electron-forge/maker-zip": "^6.0.1",
53-
"electron": "^19.0.1"
58+
"electron": "^19.0.1",
59+
"electron-builder": "^23.6.0"
5460
}
5561
}

public/main.js

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
const path = require("path");
2-
const { app, BrowserWindow, ipcMain, Notification, systemPreferences } = require("electron");
2+
const { app, BrowserWindow, ipcMain } = require("electron");
33

44
function createMainWindow() {
55
const win = new BrowserWindow({
@@ -24,7 +24,7 @@ function createMainWindow() {
2424
function createCameraWindow() {
2525
const win = new BrowserWindow({
2626
width: 120,
27-
height: 120,
27+
height: 121,
2828
maxWidth: 500,
2929
maxHeight: 500,
3030
resizable: false,
@@ -42,22 +42,9 @@ function createCameraWindow() {
4242
return win;
4343
}
4444

45-
app.whenReady().then(async () => {
46-
const camAllowed = await systemPreferences.askForMediaAccess("camera").then(async (access) => {
47-
if (!access) {
48-
new Notification({
49-
title: "Camera Access",
50-
body: "Camera access is required to use this app",
51-
}).show();
52-
return false;
53-
}
54-
return true;
55-
});
56-
57-
if (!camAllowed) {
58-
app.quit();
59-
}
45+
app.disableHardwareAcceleration(); // for windows
6046

47+
app.whenReady().then(() => {
6148
const mainWindow = createMainWindow();
6249
const camWindow = createCameraWindow();
6350
camWindow.setAlwaysOnTop(true, "floating", 1);

0 commit comments

Comments
 (0)