Adjust for another go

This commit is contained in:
Aaron Ogle 2018-01-19 15:30:34 -06:00
parent 2ec5916593
commit f2a310531a
No known key found for this signature in database
GPG Key ID: 9DE7F8BEE517326A
2 changed files with 2 additions and 5 deletions

View File

@ -436,9 +436,6 @@ const RocketChat = {
database.write(() => { database.write(() => {
data.forEach(subscription => data.forEach(subscription =>
database.create('subscriptions', subscription, true)); database.create('subscriptions', subscription, true));
});
database.write(() => {
rooms.forEach(room => rooms.forEach(room =>
database.create('rooms', room, true)); database.create('rooms', room, true));
}); });

View File

@ -81,7 +81,7 @@ export default class RoomsListView extends React.Component {
} }
getLastMessage = (subscription) => { 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); console.log('ROOM', room);
return room.lastMessage; return room.lastMessage;
} }