[FIX] Single message thread inserting thread without rid (#1999)

This commit is contained in:
Diego Mello 2020-04-06 16:07:23 -03:00 committed by GitHub
parent ee0e7bb9d1
commit afb68c74c1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 3 deletions

View File

@ -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);
} }
} }