mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2026-04-19 16:08:34 +01:00
Fix reaction field name in migration 88
This commit is contained in:
@@ -799,11 +799,9 @@ function migrateMessages(db: Database, logger: LoggerType): void {
|
||||
),
|
||||
}
|
||||
: undefined,
|
||||
reactions: reactions?.map(r =>
|
||||
migrateReaction(r, 'reactions', logger)
|
||||
),
|
||||
reactions: reactions?.map(r => migrateReaction(r)),
|
||||
storyReaction: storyReaction
|
||||
? migrateReaction(storyReaction, 'storyReaction', logger)
|
||||
? migrateReaction(storyReaction)
|
||||
: undefined,
|
||||
storyReplyContext: storyReplyContext
|
||||
? {
|
||||
@@ -1231,22 +1229,13 @@ function migrateBodyRanges(
|
||||
}
|
||||
|
||||
type LegacyReaction = JSONWithUnknownFields<{
|
||||
authorUuid?: string;
|
||||
targetAuthorUuid?: string;
|
||||
}>;
|
||||
|
||||
type UpdatedReaction = JSONWithUnknownFields<{
|
||||
authorAci: AciString | undefined;
|
||||
}>;
|
||||
type UpdatedReaction = JSONWithUnknownFields<Record<string, unknown>>;
|
||||
|
||||
function migrateReaction(
|
||||
{ authorUuid, ...legacy }: LegacyReaction,
|
||||
context: string,
|
||||
logger: LoggerType
|
||||
): UpdatedReaction {
|
||||
return {
|
||||
...legacy,
|
||||
authorAci: normalizeAci(authorUuid, context, logger),
|
||||
};
|
||||
function migrateReaction(legacy: LegacyReaction): UpdatedReaction {
|
||||
return omit(legacy, 'targetAuthorUuid');
|
||||
}
|
||||
|
||||
type LegacyGroupChange = JSONWithUnknownFields<{
|
||||
|
||||
Reference in New Issue
Block a user