modifyTargetMessage: Save other changes before applying edits
This commit is contained in:
parent
63146d2aba
commit
d9212108a3
1 changed files with 8 additions and 7 deletions
|
@ -250,6 +250,14 @@ export async function modifyTargetMessage(
|
|||
})
|
||||
);
|
||||
|
||||
// We save here before handling any edits because handleEditMessage does its own saves
|
||||
if (changed && !isFirstRun) {
|
||||
log.info(`${logId}: Changes in second run; saving.`);
|
||||
await window.Signal.Data.saveMessage(message.attributes, {
|
||||
ourAci,
|
||||
});
|
||||
}
|
||||
|
||||
// We want to make sure the message is saved first before applying any edits
|
||||
if (!isFirstRun && !skipEdits) {
|
||||
const edits = Edits.forMessage(message.attributes);
|
||||
|
@ -262,11 +270,4 @@ export async function modifyTargetMessage(
|
|||
)
|
||||
);
|
||||
}
|
||||
|
||||
if (changed && !isFirstRun) {
|
||||
log.info(`${logId}: Changes in second run; saving.`);
|
||||
await window.Signal.Data.saveMessage(message.attributes, {
|
||||
ourAci,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue