mirror of
https://gitee.com/spark-store-project/spark-store
synced 2026-04-26 01:10:16 +08:00
完成 -apm 的全部更改,实现 spk://search,移除 spk://store
This commit is contained in:
@@ -80,3 +80,28 @@ deepLink.on("install", (query) => {
|
||||
pendingActions.push(action);
|
||||
}
|
||||
});
|
||||
|
||||
deepLink.on("search", (query) => {
|
||||
logger.info(
|
||||
`Deep link: event "search" fired with query: ${JSON.stringify(query)}`,
|
||||
);
|
||||
|
||||
const action = () => {
|
||||
const win = BrowserWindow.getAllWindows()[0];
|
||||
if (!win) return;
|
||||
|
||||
if (query.pkgname) {
|
||||
win.webContents.send("deep-link-search", { pkgname: query.pkgname });
|
||||
if (win.isMinimized()) win.restore();
|
||||
win.focus();
|
||||
}
|
||||
};
|
||||
|
||||
logger.info(`isLoaded: ${isLoaded.value}`);
|
||||
|
||||
if (isLoaded.value) {
|
||||
action();
|
||||
} else {
|
||||
pendingActions.push(action);
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user