Skip to content

Commit

Permalink
🔖 0.2.41-beta
Browse files Browse the repository at this point in the history
  • Loading branch information
ircfspace committed May 4, 2024
1 parent c10f954 commit 438870b
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 49 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"url": "https://github.com/bepass-org/oblivion-desktop/issues",
"email": "[email protected]"
},
"version": "0.2.40-beta",
"version": "0.2.41-beta",
"license": "Restrictive",
"main": "./src/main/main.ts",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion release/app/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "oblivion-desktop",
"description": "unofficial desktop version of oblivion",
"version": "0.2.40-beta",
"version": "0.2.41-beta",
"homepage": "https://github.com/bepass-org/oblivion-desktop#readme",
"license": "Restrictive",
"author": "ircfspace+kiomarzsss <[email protected]> (https://ircf.space/)",
Expand Down
4 changes: 2 additions & 2 deletions src/main/ipcListeners/wp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,15 +93,15 @@ ipcMain.on('wp-start', async (event, arg) => {
command = path.join('assets', 'bin', 'warp-plus.exe');
} else {
command = String(
path.join(__dirname, 'resources', 'assets', 'bin', 'warp-plus.exe')
path.join(app.getAppPath(), 'resources', 'assets', 'bin', 'warp-plus.exe')
).replace('/app.asar', '');
}
} else {
if (isDev()) {
command = path.join('assets', 'bin', 'warp-plus');
} else {
command = String(
path.join(__dirname, 'resources', 'assets', 'bin', 'warp-plus')
path.join(app.getAppPath(), 'resources', 'assets', 'bin', 'warp-plus')
).replace('/app.asar', '');
}
}
Expand Down
91 changes: 46 additions & 45 deletions src/main/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ const createWindow = async () => {
fullscreenable: false,
icon: getAssetPath('oblivion.png'),
webPreferences: {
nativeWindowOpen: false,
devTools: false,
devToolsKeyCombination: false,
preload: app.isPackaged
Expand All @@ -97,55 +98,55 @@ const createWindow = async () => {
}

function createMainWindow() {
mainWindow = new BrowserWindow(config);
if (!mainWindow) {
mainWindow = new BrowserWindow(config);

mainWindow.loadURL(resolveHtmlPath('index.html'));
mainWindow.loadURL(resolveHtmlPath('index.html'));

mainWindow.on('ready-to-show', async () => {
if (!mainWindow) {
throw new Error('"mainWindow" is not defined');
}
// await settings.get('systemTray')
if (process.env.START_MINIMIZED) {
mainWindow.minimize();
} else {
mainWindow.show();
}
});

ipcMain.on('open-devtools', async () => {
// TODO add toggle
mainWindow?.webContents.openDevTools();
// mainWindow.webContents.closeDevTools();
});

mainWindow.on('closed', () => {
disableProxy();
mainWindow = null;
});

mainWindow.on('minimize', async (e: any) => {
e.preventDefault();
if (await settings.get('systemTray')) {
mainWindow?.hide();
}
});

const menuBuilder = new MenuBuilder(mainWindow);
menuBuilder.buildMenu();

// Open urls in the user's browser
mainWindow.webContents.setWindowOpenHandler((edata) => {
shell.openExternal(edata.url);
return { action: 'deny' };
});
mainWindow.on('ready-to-show', async () => {
if (!mainWindow) {
throw new Error('"mainWindow" is not defined');
}
// await settings.get('systemTray')
if (process.env.START_MINIMIZED) {
mainWindow.minimize();
} else {
mainWindow.show();
}
});

ipcMain.on('open-devtools', async () => {
// TODO add toggle
mainWindow?.webContents.openDevTools();
// mainWindow.webContents.closeDevTools();
});

mainWindow.on('closed', () => {
disableProxy();
mainWindow = null;
});

mainWindow.on('minimize', async (e: any) => {
e.preventDefault();
if (await settings.get('systemTray')) {
mainWindow?.hide();
}
});

const menuBuilder = new MenuBuilder(mainWindow);
menuBuilder.buildMenu();

// Open urls in the user's browser
mainWindow.webContents.setWindowOpenHandler((edata) => {
shell.openExternal(edata.url);
return { action: 'deny' };
});
} else {
mainWindow.show();
}
}

if (!mainWindow) {
createMainWindow();
} else {
mainWindow.show();
}
createMainWindow();

let appIcon = null;
app?.whenReady().then(() => {
Expand Down

0 comments on commit 438870b

Please sign in to comment.