fix: sort injected entries by canonical defaults order after sync
Security Scan and Upload / Security & DefectDojo Upload (push) Successful in 1m9s
CI / Lint, Build & Test (push) Failing after 1m13s

This commit is contained in:
2026-03-23 18:18:59 -07:00
committed by Naomi Carrigan
parent e92cf3c9a1
commit a7a255dab6
3 changed files with 36 additions and 29 deletions
+7
View File
@@ -533,6 +533,13 @@ const injectMissingEntries = <T extends { id: string }>(
added = added + 1; added = added + 1;
} }
} }
const defaultOrder = new Map(defaults.map((item, index) => {
return [ item.id, index ] as const;
}));
existing.sort((itemA, itemB) => {
return (defaultOrder.get(itemA.id) ?? Number.MAX_SAFE_INTEGER)
- (defaultOrder.get(itemB.id) ?? Number.MAX_SAFE_INTEGER);
});
return added; return added;
}; };
+1 -1
View File
@@ -2304,6 +2304,7 @@ export const GameProvider = ({
startQuest, startQuest,
state, state,
syncError, syncError,
syncNewContent,
toggleAutoAdventurer, toggleAutoAdventurer,
toggleAutoBoss, toggleAutoBoss,
toggleAutoPrestige, toggleAutoPrestige,
@@ -2313,7 +2314,6 @@ export const GameProvider = ({
unlockedAchievements, unlockedAchievements,
unlockedCodexEntryIds, unlockedCodexEntryIds,
unlockedStoryChapterIds, unlockedStoryChapterIds,
syncNewContent,
}; };
}, [ }, [
apotheosis, apotheosis,