fix: ignore falsy last_status (#2099)

Fixes #2097
fix-multi-polls
Nolan Lawson 2021-12-27 20:57:16 -08:00 zatwierdzone przez GitHub
rodzic 58ff6beb26
commit f3c5e7de5f
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
2 zmienionych plików z 5 dodań i 2 usunięć

Wyświetl plik

@ -35,7 +35,10 @@ export function processMessage (instanceName, timelineName, message) {
// reproduce what is done for statuses for the conversation.
//
// It will add new DMs as new conversations instead of updating existing threads
addStatusOrNotification(instanceName, timelineName, payload.last_status)
if (payload.last_status) {
// If the last_status doesn't exist, just ignore it. There's not much we can do in that case
addStatusOrNotification(instanceName, timelineName, payload.last_status)
}
break
case 'filters_changed':
emit('wordFiltersChanged', instanceName)

Wyświetl plik

@ -75,7 +75,7 @@ export async function getTimeline (instanceName, accessToken, timeline, maxId, s
let { json: items, headers } = await getWithHeaders(url, auth(accessToken), { timeout: DEFAULT_TIMEOUT })
if (timeline === 'direct') {
items = items.map(item => item.last_status)
items = items.map(item => item.last_status).filter(Boolean) // ignore falsy last_status'es
}
return { items, headers }
}