fix deletes causing errors

This commit is contained in:
Henry Jameson 2019-12-11 18:20:43 +02:00
parent 6acd889589
commit 63a5f50e7c

View file

@ -1010,6 +1010,10 @@ export const handleMastoWS = (wsEvent) => {
const parsedEvent = JSON.parse(data)
const { event, payload } = parsedEvent
if (MASTODON_STREAMING_EVENTS.has(event)) {
// MastoBE and PleromaBE both send payload for delete as a PLAIN string
if (event === 'delete') {
return { event, id: payload }
}
const data = payload ? JSON.parse(payload) : null
if (event === 'update') {
return { event, status: parseStatus(data) }