mirror of
https://github.com/Llewellynvdm/nativefier.git
synced 2024-09-22 09:39:02 +00:00
app: handle nativefier.json readonly access with options.maximize (#856)
**Resolves #855** **Example result upon Terminal launch:** `WARNING: Ignored nativefier.json rewrital (Error: EACCES: permission denied, open '/usr/lib/jupyter-remote-client/resources/app/nativefier.json')` **Behaviour:** + Instead of crashing, the application properly opens and is always maximized. + When permissions are R/W, the application is maximized on first launch and the closing states are remembered by the OS throughout launches.
This commit is contained in:
parent
e00f08e5d6
commit
84f06e3e79
@ -140,10 +140,15 @@ function createMainWindow(inpOptions, onAppQuit, setDockBadge) {
|
|||||||
if (options.maximize) {
|
if (options.maximize) {
|
||||||
mainWindow.maximize();
|
mainWindow.maximize();
|
||||||
options.maximize = undefined;
|
options.maximize = undefined;
|
||||||
fs.writeFileSync(
|
try {
|
||||||
path.join(__dirname, '..', 'nativefier.json'),
|
fs.writeFileSync(
|
||||||
JSON.stringify(options),
|
path.join(__dirname, '..', 'nativefier.json'),
|
||||||
);
|
JSON.stringify(options),
|
||||||
|
);
|
||||||
|
} catch (exception) {
|
||||||
|
// eslint-disable-next-line no-console
|
||||||
|
console.log(`WARNING: Ignored nativefier.json rewrital (${exception})`);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const withFocusedWindow = (block) => {
|
const withFocusedWindow = (block) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user