Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prepare release #18

Merged
merged 2 commits into from
Feb 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ To use `.AppImage` files in Linux, [install FUSE](https://github.com/AppImage/Ap
sudo apt install libfuse2
```

Then simply [execute/run](https://github.com/AppImage/AppImageKit/wiki) the `.AppImage` file, which you can download from [Releases](releases).
Then simply [execute/run](https://github.com/AppImage/AppImageKit/wiki) the `.AppImage` file, which you can download from [Releases](/paranext/paranext-core/releases).

## Developer Install

Expand Down
32 changes: 24 additions & 8 deletions package-lock.json

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

5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@
"electron-debug": "^3.2.0",
"electron-log": "^4.4.8",
"electron-updater": "^5.2.3",
"electron-window-state": "^5.0.3",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-router-dom": "^6.4.0"
Expand Down Expand Up @@ -224,7 +225,9 @@
},
"win": {
"target": [
"nsis"
"nsis",
"nsis-web",
"portable"
]
},
"linux": {
Expand Down
18 changes: 16 additions & 2 deletions src/main/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import path from 'path';
import { app, BrowserWindow, shell, ipcMain } from 'electron';
import { autoUpdater } from 'electron-updater';
import log from 'electron-log';
import windowStateKeeper from 'electron-window-state';
import MenuBuilder from './menu';
import { resolveHtmlPath } from './util';

Expand Down Expand Up @@ -69,10 +70,18 @@ const createWindow = async () => {
return path.join(RESOURCES_PATH, ...paths);
};

// Load the previous state with fallback to defaults
const mainWindowState = windowStateKeeper({
defaultWidth: 1024,
defaultHeight: 728,
});

mainWindow = new BrowserWindow({
show: false,
width: 1024,
height: 728,
x: mainWindowState.x,
y: mainWindowState.y,
width: mainWindowState.width,
height: mainWindowState.height,
icon: getAssetPath('icon.png'),
webPreferences: {
preload: app.isPackaged
Expand All @@ -81,6 +90,11 @@ const createWindow = async () => {
},
});

// Register listeners on the window, so the state is updated automatically
// (the listeners will be removed when the window is closed)
// and restore the maximized or full screen state
mainWindowState.manage(mainWindow);

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

mainWindow.on('ready-to-show', () => {
Expand Down
4 changes: 2 additions & 2 deletions src/renderer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ const root = createRoot(container);
root.render(<App />);

// calling IPC exposed from preload script
window.electron.ipcRenderer.once('ipc-example', (arg) => {
window.electron?.ipcRenderer.once('ipc-example', (arg) => {
// eslint-disable-next-line no-console
console.log(arg);
});
window.electron.ipcRenderer.sendMessage('ipc-example', ['ping']);
window.electron?.ipcRenderer.sendMessage('ipc-example', ['ping']);