| Línea 10... |
Línea 10... |
| 10 |
click(element)
|
10 |
click(element)
|
| 11 |
}
|
11 |
}
|
| Línea 12... |
Línea 12... |
| 12 |
|
12 |
|
| Línea 13... |
Línea 13... |
| 13 |
const getLastMessage = () => {
|
13 |
const getLastMessage = () => {
|
| 14 |
|
- |
|
| 15 |
filtredConversations.forEach(option => console.log(option))
|
14 |
|
| Línea 16... |
Línea 15... |
| 16 |
|
15 |
const nullTimeOptions = filtredConversations.filter(option => !option.last_message)
|
| Línea -... |
Línea 16... |
| - |
|
16 |
const numberTimeOptions = filtredConversations.filter(option => option.last_message.split(' ').length > 1)
|
| - |
|
17 |
|
| - |
|
18 |
const nowTimeOptions = filtredConversations.filter(option => option.last_message === 'Ahora')
|
| - |
|
19 |
|
| - |
|
20 |
const secondsTimeOptions = numberTimeOptions.filter(option => option.last_message.split(' ')[1].includes('segundo')).sort((a, b) => a.last_message.split(' ')[0] - b.last_message.split(' ')[0])
|
| - |
|
21 |
const minutesTimeOptions = numberTimeOptions.filter(option => option.last_message.split(' ')[1].includes('minuto')).sort((a, b) => a.last_message.split(' ')[0] - b.last_message.split(' ')[0])
|
| Línea 17... |
Línea 22... |
| 17 |
const nullTimeOptions = filtredConversations.filter(option => !option.time)
|
22 |
const dayTimeOptions = numberTimeOptions.filter(option => option.last_message.split(' ')[1].includes('dia')).sort((a, b) => a.last_message.split(' ')[0] - b.last_message.split(' ')[0])
|
| 18 |
|
23 |
const weekTimeOptions = numberTimeOptions.filter(option => option.last_message.split(' ')[1].includes('semana')).sort((a, b) => a.last_message.split(' ')[0] - b.last_message.split(' ')[0])
|
| - |
|
24 |
const monthTimeOptions = numberTimeOptions.filter(option => option.last_message.split(' ')[1].includes('mes')).sort((a, b) => a.last_message.split(' ')[0] - b.last_message.split(' ')[0])
|
| - |
|
25 |
const yearTimeOptions = numberTimeOptions.filter(option => option.last_message.split(' ')[1].includes('año')).sort((a, b) => a.last_message.split(' ')[0] - b.last_message.split(' ')[0])
|
| - |
|
26 |
|
| - |
|
27 |
return [
|
| - |
|
28 |
...nowTimeOptions,
|
| - |
|
29 |
...secondsTimeOptions,
|
| 19 |
const nowTimeOptions = filtredConversations.filter(option => option.time === 'Ahora')
|
30 |
...minutesTimeOptions,
|
| 20 |
|
31 |
...dayTimeOptions,
|
| 21 |
|
32 |
...weekTimeOptions,
|
| Línea 22... |
Línea 33... |
| 22 |
return [
|
33 |
...monthTimeOptions,
|