mirror of
https://github.com/LukeHagar/sveltekit-adapters.git
synced 2025-12-06 12:47:48 +00:00
chore: Update load function in adapter-electron to include optional path parameter
This commit is contained in:
@@ -1,2 +1,2 @@
|
||||
export function load(mainWindow: any, port: string | undefined): void;
|
||||
export function load(mainWindow: any, port: string | undefined, path: string | undefined): void;
|
||||
export function start(): Promise<string | undefined>;
|
||||
|
||||
@@ -31,12 +31,12 @@ export const start = async () => {
|
||||
};
|
||||
|
||||
/** @type {import('./index.js').load} */
|
||||
export const load = (mainWindow, port) => {
|
||||
export const load = (mainWindow, port, path = '') => {
|
||||
if (isDev && process.env['ELECTRON_RENDERER_URL']) {
|
||||
log.info(`Loading url: ${process.env['ELECTRON_RENDERER_URL']}`);
|
||||
mainWindow.loadURL(process.env['ELECTRON_RENDERER_URL']);
|
||||
log.info(`Loading url: ${process.env['ELECTRON_RENDERER_URL']}${path}`);
|
||||
mainWindow.loadURL(process.env['ELECTRON_RENDERER_URL']+path);
|
||||
} else {
|
||||
log.info(`Loading url: http://localhost:${port}`);
|
||||
mainWindow.loadURL(`http://localhost:${port}`);
|
||||
log.info(`Loading url: http://localhost:${port}${path}`);
|
||||
mainWindow.loadURL(`http://localhost:${port}${path}`);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user