fix: remove blocks when updating an old message (#5522)
* fix: remove blocks when updating an old message * minior tweak, add to threadMessagesToUpdate * remove the comments
This commit is contained in:
parent
39f8a92059
commit
cc7d0893e7
|
@ -136,6 +136,9 @@ export default async function updateMessages({
|
||||||
try {
|
try {
|
||||||
return message.prepareUpdate(
|
return message.prepareUpdate(
|
||||||
protectedFunction((m: TMessageModel) => {
|
protectedFunction((m: TMessageModel) => {
|
||||||
|
if (newMessage && !newMessage?.blocks) {
|
||||||
|
newMessage.blocks = null;
|
||||||
|
}
|
||||||
Object.assign(m, newMessage);
|
Object.assign(m, newMessage);
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
@ -160,6 +163,9 @@ export default async function updateMessages({
|
||||||
try {
|
try {
|
||||||
return threadMessage.prepareUpdate(
|
return threadMessage.prepareUpdate(
|
||||||
protectedFunction((tm: TThreadMessageModel) => {
|
protectedFunction((tm: TThreadMessageModel) => {
|
||||||
|
if (newThreadMessage && !newThreadMessage?.blocks) {
|
||||||
|
newThreadMessage.blocks = null;
|
||||||
|
}
|
||||||
Object.assign(tm, newThreadMessage);
|
Object.assign(tm, newThreadMessage);
|
||||||
if (threadMessage.tmid) {
|
if (threadMessage.tmid) {
|
||||||
tm.rid = threadMessage.tmid;
|
tm.rid = threadMessage.tmid;
|
||||||
|
|
Loading…
Reference in New Issue