modifyTargetMessage: Save other changes before applying edits
This commit is contained in:
@@ -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,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user