fix(chat): migrate legacy character cache identities
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
const LEGACY_CHARACTER_ID_ALIASES: Readonly<Record<string, string>> =
|
||||
Object.freeze({
|
||||
character_elio: "elio",
|
||||
character_maya: "maya-tan",
|
||||
character_nayeli: "nayeli-cervantes",
|
||||
});
|
||||
|
||||
/**
|
||||
* Converts character IDs persisted by pre-catalog releases to the current
|
||||
* backend IDs. Unknown and already-current IDs pass through unchanged.
|
||||
*/
|
||||
export function normalizeLegacyCharacterId(characterId: string): string {
|
||||
return LEGACY_CHARACTER_ID_ALIASES[characterId] ?? characterId;
|
||||
}
|
||||
Reference in New Issue
Block a user