mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-05-27 12:55:20 -07:00
feat(macos): configuration window + curl-backed macOS updater (#71)
This commit is contained in:
@@ -5,6 +5,9 @@ interface SetupWindowConfig {
|
||||
resizable?: boolean;
|
||||
minimizable?: boolean;
|
||||
maximizable?: boolean;
|
||||
preloadPath?: string;
|
||||
sandbox?: boolean;
|
||||
backgroundColor?: string;
|
||||
}
|
||||
|
||||
function createSetupWindowHandler<TWindow>(
|
||||
@@ -21,9 +24,12 @@ function createSetupWindowHandler<TWindow>(
|
||||
...(config.resizable === undefined ? {} : { resizable: config.resizable }),
|
||||
...(config.minimizable === undefined ? {} : { minimizable: config.minimizable }),
|
||||
...(config.maximizable === undefined ? {} : { maximizable: config.maximizable }),
|
||||
...(config.backgroundColor === undefined ? {} : { backgroundColor: config.backgroundColor }),
|
||||
webPreferences: {
|
||||
nodeIntegration: false,
|
||||
contextIsolation: true,
|
||||
...(config.sandbox === undefined ? {} : { sandbox: config.sandbox }),
|
||||
...(config.preloadPath ? { preload: config.preloadPath } : {}),
|
||||
},
|
||||
});
|
||||
}
|
||||
@@ -60,3 +66,18 @@ export function createCreateAnilistSetupWindowHandler<TWindow>(deps: {
|
||||
title: 'Anilist Setup',
|
||||
});
|
||||
}
|
||||
|
||||
export function createCreateConfigSettingsWindowHandler<TWindow>(deps: {
|
||||
createBrowserWindow: (options: Electron.BrowserWindowConstructorOptions) => TWindow;
|
||||
preloadPath: string;
|
||||
}) {
|
||||
return createSetupWindowHandler(deps, {
|
||||
width: 1040,
|
||||
height: 760,
|
||||
title: 'SubMiner Configuration',
|
||||
resizable: true,
|
||||
preloadPath: deps.preloadPath,
|
||||
sandbox: false,
|
||||
backgroundColor: '#24273a',
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user