Avoid unnecessary stringification when saving new message
This commit is contained in:
parent
be8da842b8
commit
a9ac3897d0
1 changed files with 3 additions and 4 deletions
|
@ -2274,9 +2274,8 @@ export function saveMessage(
|
||||||
seenStatus = SeenStatus.Unseen;
|
seenStatus = SeenStatus.Unseen;
|
||||||
}
|
}
|
||||||
|
|
||||||
const payload = {
|
const payloadWithoutJson = {
|
||||||
id,
|
id,
|
||||||
json: objectToJSON(data),
|
|
||||||
|
|
||||||
body: body || null,
|
body: body || null,
|
||||||
conversationId,
|
conversationId,
|
||||||
|
@ -2334,7 +2333,7 @@ export function saveMessage(
|
||||||
seenStatus = $seenStatus
|
seenStatus = $seenStatus
|
||||||
WHERE id = $id;
|
WHERE id = $id;
|
||||||
`
|
`
|
||||||
).run(payload);
|
).run({ ...payloadWithoutJson, json: objectToJSON(data) });
|
||||||
|
|
||||||
if (jobToInsert) {
|
if (jobToInsert) {
|
||||||
insertJob(db, jobToInsert);
|
insertJob(db, jobToInsert);
|
||||||
|
@ -2406,7 +2405,7 @@ export function saveMessage(
|
||||||
);
|
);
|
||||||
`
|
`
|
||||||
).run({
|
).run({
|
||||||
...payload,
|
...payloadWithoutJson,
|
||||||
id: toCreate.id,
|
id: toCreate.id,
|
||||||
json: objectToJSON(toCreate),
|
json: objectToJSON(toCreate),
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Reference in a new issue