Skip to content

Commit

Permalink
Fix dev, add CSP, v1.2.0-beta2
Browse files Browse the repository at this point in the history
  • Loading branch information
JovannMC committed Jul 25, 2024
1 parent 6a035ef commit 6d9d21b
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 8 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "slimetora",
"productName": "slimetora",
"type": "module",
"version": "1.2.0-beta1",
"version": "1.2.0-beta2",
"description": "A program that connects the HaritoraX full body trackers to the SlimeVR server",
"private": true,
"author": {
Expand Down
11 changes: 6 additions & 5 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,6 @@ let connectionActive = false;
const resources = await loadTranslations();
let comPorts = await Binding.list();

function isDevelopment() {
return process.env.DEVELOPMENT || !app.isPackaged;
}

/*
* Translations (i18next)
*/
Expand Down Expand Up @@ -163,7 +159,7 @@ app.commandLine.appendSwitch("force_low_power_gpu");

// Don't show the menu bar for performance (this disables the dev tools though, may remove this later)
// could also set this depending on "logging mode" setting in config
if (!isDevelopment) {
if (!process.env.DEVELOPMENT && app.isPackaged) {
log("Development mode disabled, hiding menu bar");
Menu.setApplicationMenu(null);
} else {
Expand Down Expand Up @@ -238,6 +234,7 @@ ipcMain.handle("get-com-ports", async (_event, arg: string) => {

if (!device) {
initializeDevice(true);
// @ts-ignore
const ports = await device.getDevicePorts(arg);
device = undefined;
return ports;
Expand Down Expand Up @@ -339,6 +336,7 @@ ipcMain.handle("autodetect", async () => {
initializeDevice(true);

log("Auto-detect: getting available devices...");
// @ts-ignore
const devices = await device.getAvailableDevices();

let trackerSettingsTimeout: NodeJS.Timeout = null;
Expand All @@ -351,16 +349,19 @@ ipcMain.handle("autodetect", async () => {
}
if (devices.includes("GX6")) {
log("Auto-detect: GX6 device found, starting connection...");
// @ts-ignore
comPorts = await device.getDevicePorts("GX6");
device.startConnection("com", comPorts, heartbeatInterval);
}
if (devices.includes("GX2")) {
log("Auto-detect: GX2 device found, starting connection...");
// @ts-ignore
comPorts = await device.getDevicePorts("GX2");
device.startConnection("com", comPorts, heartbeatInterval);
}
if (devices.includes("HaritoraX Wired")) {
log("Auto-detect: HaritoraX Wired device found, starting connection...");
// @ts-ignore
comPorts = await device.getDevicePorts("HaritoraX Wired");
device.startConnection("com", comPorts, heartbeatInterval);
}
Expand Down
1 change: 1 addition & 0 deletions src/static/html/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-inline';">
<link rel="stylesheet" href="../css/index.css" />
<script src="../js/index.js"></script>
</head>
Expand Down
1 change: 1 addition & 0 deletions src/static/html/settings.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-inline';">
<link rel="stylesheet" href="../css/index.css" />
<script src="../js/settings.js"></script>
</head>
Expand Down
1 change: 1 addition & 0 deletions src/static/html/visualization.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-inline';">
<title>Tracker visualization</title>
<style>
body {
Expand Down

0 comments on commit 6d9d21b

Please sign in to comment.