Skip to content
This repository has been archived by the owner on Nov 5, 2024. It is now read-only.

Commit

Permalink
fix: auto generate uuid
Browse files Browse the repository at this point in the history
  • Loading branch information
ids93216 committed May 3, 2024
1 parent 4922536 commit b1b8e3c
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
6 changes: 6 additions & 0 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,12 @@ function createWindow() {
checkForUpdates();
setInterval(() => checkForUpdates(), 600_000);
});
MainWindow.webContents.executeJavaScript("localStorage.getItem(\"UUID\")").then(value => {
if (!value) {
const uuid = require("uuid").v4();
MainWindow.webContents.executeJavaScript(`localStorage.setItem("UUID","${uuid}")`);
}
});
MainWindow.webContents.executeJavaScript("localStorage.getItem(\"init\")").then(value => {
if (!value) {
MainWindow.webContents.executeJavaScript("localStorage.setItem(\"init\",true)").then(v => {
Expand Down
13 changes: 13 additions & 0 deletions src/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion src/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@
"node-fetch": "^2.6.7",
"require-reload": "^0.2.2",
"speak-tts": "^2.0.8",
"uuid": "^9.0.1",
"ws": "^8.14.2"
}
}
}

0 comments on commit b1b8e3c

Please sign in to comment.