fix(sync): resolve restore item edge cases

This commit is contained in:
2026-05-19 01:50:34 +08:00
parent acffb6c5ee
commit 753f91e837
4 changed files with 97 additions and 7 deletions
+5 -4
View File
@@ -1583,12 +1583,13 @@ const openRestoreFromAccount = async (): Promise<void> => {
const installCloudItems = (items: SyncedAppListItem[]): void => {
for (const item of items) {
const app = apps.value.find(
const candidates = apps.value.filter(
(candidate) =>
candidate.pkgname === item.pkgname &&
candidate.origin === item.origin &&
candidate.category === item.category,
candidate.pkgname === item.pkgname && candidate.origin === item.origin,
);
const app =
candidates.find((candidate) => candidate.category === item.category) ??
candidates[0];
if (!app) continue;
void onDetailInstall(app);
}