Skip to content

Commit

Permalink
revert: remove async from main load process
Browse files Browse the repository at this point in the history
  • Loading branch information
javierguzman committed Aug 9, 2023
1 parent a5f9a0c commit 5e40db9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/main/createWindow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { configureUSB } from "./setup/configureUSB";
declare const MAIN_WINDOW_WEBPACK_ENTRY: string;
declare const MAIN_WINDOW_PRELOAD_WEBPACK_ENTRY: string;

const createWindow = async (): Promise<void> => {
const createWindow = () => {
// Create the browser window.
const mainWindowState = windowStateKeeper({
defaultWidth: 1200,
Expand Down Expand Up @@ -62,7 +62,7 @@ const createWindow = async (): Promise<void> => {
onReadyToShow();
onDevTools();
onClose();
await configureUSB();
configureUSB();
};

export default createWindow;
4 changes: 2 additions & 2 deletions src/main/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ app.on("ready", async () => {
setBackup();
setTheme();
// await setDevTools(); devtools do not work with latest electron
await createWindow();
createWindow();
// we do not want a menu on top of the window
Menu.setApplicationMenu(null);
});
Expand All @@ -45,7 +45,7 @@ app.on("activate", async () => {
// On OS X it's common to re-create a window in the app when the
// dock icon is clicked and there are no other windows open.
if (BrowserWindow.getAllWindows().length === 0) {
await createWindow();
createWindow();
}
});

Expand Down
4 changes: 2 additions & 2 deletions src/main/setup/configureUSB.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export const getDevices = () => {
return devices;
};

export const configureUSB = async () => {
export const configureUSB = () => {
ipcMain.handle("usb-devices", () => {
const devices = getDeviceList();
return devices;
Expand All @@ -81,5 +81,5 @@ export const configureUSB = async () => {
// connect/disconnect events, but it only sends disconnect events for devices
// it knows. If there are devices connected when we start up, we need to scan
// them first to notice disconnects. We do that here.
await webusb.getDevices();
webusb.getDevices();
};

0 comments on commit 5e40db9

Please # to comment.