mirror of
https://github.com/scratchfoundation/scratch-desktop.git
synced 2024-12-23 06:02:30 -05:00
fix "about" window in packaged context
This commit is contained in:
parent
8dcbbfe5c9
commit
53812d79c7
1 changed files with 5 additions and 5 deletions
|
@ -16,7 +16,7 @@ const isDevelopment = process.env.NODE_ENV !== 'production';
|
||||||
// global window references prevent them from being garbage-collected
|
// global window references prevent them from being garbage-collected
|
||||||
const _windows = {};
|
const _windows = {};
|
||||||
|
|
||||||
const createWindow = ({url, ...browserWindowOptions}) => {
|
const createWindow = ({search = null, url = 'index.html', ...browserWindowOptions}) => {
|
||||||
const window = new BrowserWindow({
|
const window = new BrowserWindow({
|
||||||
useContentSize: true,
|
useContentSize: true,
|
||||||
show: false,
|
show: false,
|
||||||
|
@ -48,6 +48,7 @@ const createWindow = ({url, ...browserWindowOptions}) => {
|
||||||
window.loadURL(formatUrl({
|
window.loadURL(formatUrl({
|
||||||
pathname: path.join(__dirname, url),
|
pathname: path.join(__dirname, url),
|
||||||
protocol: 'file',
|
protocol: 'file',
|
||||||
|
search,
|
||||||
slashes: true
|
slashes: true
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
@ -60,8 +61,8 @@ const createAboutWindow = () => {
|
||||||
width: 400,
|
width: 400,
|
||||||
height: 400,
|
height: 400,
|
||||||
parent: _windows.main,
|
parent: _windows.main,
|
||||||
title: 'About Scratch Desktop',
|
search: 'route=about',
|
||||||
url: 'index.html?route=about'
|
title: 'About Scratch Desktop'
|
||||||
});
|
});
|
||||||
return window;
|
return window;
|
||||||
};
|
};
|
||||||
|
@ -70,8 +71,7 @@ const createMainWindow = () => {
|
||||||
const window = createWindow({
|
const window = createWindow({
|
||||||
width: defaultSize.width,
|
width: defaultSize.width,
|
||||||
height: defaultSize.height,
|
height: defaultSize.height,
|
||||||
title: 'Scratch Desktop',
|
title: 'Scratch Desktop'
|
||||||
url: 'index.html'
|
|
||||||
});
|
});
|
||||||
const webContents = window.webContents;
|
const webContents = window.webContents;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue