mirror of
https://gitee.com/spark-store-project/spark-store
synced 2026-04-26 01:10:16 +08:00
feat: implement store filter based on launch arguments
- Added a new function to determine the store filter based on the `--no-apm` and `--no-spark` launch arguments. - Integrated IPC to retrieve the store filter in the main process and updated the Vue component to reflect the selected filter. - Adjusted logic in the app loading functions to conditionally display apps based on the determined filter.
This commit is contained in:
@@ -74,6 +74,22 @@ const getUserAgent = (): string => {
|
||||
|
||||
logger.info("User Agent: " + getUserAgent());
|
||||
|
||||
/** 根据启动参数 --no-apm / --no-spark 决定只展示的来源 */
|
||||
function getStoreFilterFromArgv(): "spark" | "apm" | "both" {
|
||||
const argv = process.argv;
|
||||
const noApm = argv.includes("--no-apm");
|
||||
const noSpark = argv.includes("--no-spark");
|
||||
if (noApm && noSpark) return "both";
|
||||
if (noApm) return "spark";
|
||||
if (noSpark) return "apm";
|
||||
return "both";
|
||||
}
|
||||
|
||||
ipcMain.handle(
|
||||
"get-store-filter",
|
||||
(): "spark" | "apm" | "both" => getStoreFilterFromArgv(),
|
||||
);
|
||||
|
||||
async function createWindow() {
|
||||
win = new BrowserWindow({
|
||||
title: "星火应用商店",
|
||||
|
||||
Reference in New Issue
Block a user