[FIX] Single message thread inserting thread without rid (#1999)
This commit is contained in:
parent
ee0e7bb9d1
commit
afb68c74c1
|
@ -670,7 +670,6 @@ class RoomView extends React.Component {
|
||||||
// eslint-disable-next-line react/sort-comp
|
// eslint-disable-next-line react/sort-comp
|
||||||
fetchThreadName = async(tmid, messageId) => {
|
fetchThreadName = async(tmid, messageId) => {
|
||||||
try {
|
try {
|
||||||
const { room } = this.state;
|
|
||||||
const db = database.active;
|
const db = database.active;
|
||||||
const threadCollection = db.collections.get('threads');
|
const threadCollection = db.collections.get('threads');
|
||||||
const messageCollection = db.collections.get('messages');
|
const messageCollection = db.collections.get('messages');
|
||||||
|
@ -693,7 +692,7 @@ class RoomView extends React.Component {
|
||||||
await db.batch(
|
await db.batch(
|
||||||
threadCollection.prepareCreate((t) => {
|
threadCollection.prepareCreate((t) => {
|
||||||
t._raw = sanitizedRaw({ id: thread._id }, threadCollection.schema);
|
t._raw = sanitizedRaw({ id: thread._id }, threadCollection.schema);
|
||||||
t.subscription.set(room);
|
t.subscription.id = this.rid;
|
||||||
Object.assign(t, thread);
|
Object.assign(t, thread);
|
||||||
}),
|
}),
|
||||||
messageRecord.prepareUpdate((m) => {
|
messageRecord.prepareUpdate((m) => {
|
||||||
|
@ -703,7 +702,7 @@ class RoomView extends React.Component {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
log(e);
|
// log(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue