Adjust for another go
This commit is contained in:
parent
2ec5916593
commit
f2a310531a
|
@ -432,13 +432,10 @@ const RocketChat = {
|
|||
}
|
||||
return subscription;
|
||||
});
|
||||
|
||||
|
||||
database.write(() => {
|
||||
data.forEach(subscription =>
|
||||
database.create('subscriptions', subscription, true));
|
||||
});
|
||||
|
||||
database.write(() => {
|
||||
rooms.forEach(room =>
|
||||
database.create('rooms', room, true));
|
||||
});
|
||||
|
|
|
@ -81,7 +81,7 @@ export default class RoomsListView extends React.Component {
|
|||
}
|
||||
|
||||
getLastMessage = (subscription) => {
|
||||
const room = database.objects('rooms').sorted('_updatedAt', true).slice().find(({ _id }) => _id === subscription.rid);
|
||||
const [ room ] = database.objects('rooms').filtered('_id = $0', subscription.rid).slice();
|
||||
console.log('ROOM', room);
|
||||
return room.lastMessage;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue