refactor: 添加深度链接处理程序以支持更新、安装和已安装事件

This commit is contained in:
Elysia
2026-01-30 21:54:51 +08:00
parent fff4a4bd22
commit de1fe65045
2 changed files with 61 additions and 1 deletions

View File

@@ -515,6 +515,37 @@ onMounted(async () => {
closeDetail();
}
});
// Deep link Handlers
window.ipcRenderer.on('deep-link-update', () => {
openUpdateModal();
});
window.ipcRenderer.on('deep-link-installed', () => {
openInstalledModal();
});
window.ipcRenderer.on('deep-link-install', (_event, pkgname) => {
const tryOpen = () => {
const target = apps.value.find(a => a.Pkgname === pkgname);
if (target) {
openDetail(target);
} else {
logger.warn(`Deep link: app ${pkgname} not found`);
}
};
if (loading.value) {
const stop = watch(loading, (val) => {
if (!val) {
tryOpen();
stop();
}
});
} else {
tryOpen();
}
});
});
// 观察器