|
@@ -20,7 +20,8 @@ export function RoomScreen({ route }) {
|
20
|
20
|
.filter(({ type }) => type == 'added') //el objeto tiene un prop added, ese es el que queremos
|
21
|
21
|
.map(({ doc }) => {
|
22
|
22
|
const message = doc.data()
|
23
|
|
- return { ...message, createdAt: new Date().getTime() }
|
|
23
|
+ //return { ...message, createdAt: new Date().getTime() }
|
|
24
|
+ return { ...message, createdAt: message.createdAt.toDate() }
|
24
|
25
|
})
|
25
|
26
|
.sort((a, b) => b.createdAt - a.createdAt)
|
26
|
27
|
appendMessages(messageFirestore) //Para meter el mensaje en el estado messages
|
|
@@ -44,7 +45,7 @@ export function RoomScreen({ route }) {
|
44
|
45
|
|
45
|
46
|
|
46
|
47
|
return (
|
47
|
|
- <GiftedChat messages={messages} user={{ _id: 1 }} onSend={handleSend} />
|
|
48
|
+ <GiftedChat messages={messages} user={{ _id: firebase.auth().currentUser.uid }} onSend={handleSend} />
|
48
|
49
|
);
|
49
|
50
|
}
|
50
|
51
|
|