Skip to content

Commit

Permalink
even more fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
dylanvorster committed Feb 26, 2024
1 parent 9c98a59 commit c03564b
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 9 deletions.
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"dependencies": {
"@jitsi/robotjs": "^0.6.13",
"auto-launch": "^5.0.6",
"async": "^3.2.5",
"electron-json-storage": "^4.6.0",
"lodash": "^4.17.21",
"node-hid": "^3.0.0",
Expand All @@ -45,6 +46,7 @@
"node-mac-permissions": "^2.3.0"
},
"devDependencies": {
"@types/async": "^3.2.24",
"@types/auto-launch": "^5.0.5",
"@types/electron-json-storage": "^4.5.4",
"@types/lodash": "^4.14.202",
Expand Down
10 changes: 10 additions & 0 deletions pnpm-lock.yaml

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

4 changes: 2 additions & 2 deletions src/PointerEngine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ export class PointerDevice extends BaseObserver<PointerDeviceListener> {
this.resource.on('error', error_cb);
this.resource.on('data', data_cb);
this.dispose = () => {
this.resource.off('error', error_cb);
this.resource.off('data', data_cb);
this.resource?.off('error', error_cb);
this.resource?.off('data', data_cb);
this.dispose = null;
};
}
Expand Down
16 changes: 9 additions & 7 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import AutoLaunch from 'auto-launch';
import { createLogger, transports } from 'winston';
import { buildLoadingMenu, buildMenu } from './menu';
import { waitForAllPermissions } from './permissions';
import {} from 'async';

require('source-map-support').install();

Expand Down Expand Up @@ -69,12 +70,7 @@ app.on('ready', async () => {
setupMovement();
};

pointerEngine.registerListener({
devicesChanged: () => {
buildMenuWrapped();
setupMovement();
}
});
configEngine.init();

// add a startup delay
const delay = (configEngine.config.startupDelay || 0) * 1_000;
Expand All @@ -85,10 +81,16 @@ app.on('ready', async () => {

// might want startup delay
setTimeout(() => {
configEngine.init();
pointerEngine.init();
displayEngine.init();

pointerEngine.registerListener({
devicesChanged: () => {
buildMenuWrapped();
setupMovement();
}
});

buildMenuWrapped();
setupMovement();
}, delay);
Expand Down

0 comments on commit c03564b

Please sign in to comment.