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:
2026-03-15 11:04:22 +08:00
parent 4ecea4a8b8
commit b3ca2973f1
4 changed files with 26 additions and 4 deletions

View File

@@ -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: "星火应用商店",