Skip to content

Commit

Permalink
adding config dynamic
Browse files Browse the repository at this point in the history
  • Loading branch information
willwade committed Oct 30, 2024
1 parent 477daaf commit 3c0df5a
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions nodejs/sender-monitor/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,23 @@ const webrtc = require("./webrtc");
const QRCode = require("qrcode");
const { Monitor } = require("node-screenshots");
const { performOCR } = require("./ocr");
const config = require("./config.json");

let tray;
let qrWindow;
let lastText = "";
let isConnected = false;

const logFilePath = path.join(app.getPath("userData"), "log.txt");
const configFilePath = path.join(__dirname, "config.json");

const configFilePath = app.isPackaged
? path.join(app.getPath("userData"), "config.json")
: path.join(__dirname, "config.json");

if (app.isPackaged && !fs.existsSync(configFilePath)) {
fs.copyFileSync(path.join(__dirname, "config.json"), configFilePath);
}

let config = JSON.parse(fs.readFileSync(configFilePath, "utf-8"));


ipcMain.on("close-qr-window", () => {
if (qrWindow) {
Expand Down

0 comments on commit 3c0df5a

Please sign in to comment.