Merge pull request 'don't try to parse pong' (#54) from json-fix into develop
ci/woodpecker/push/woodpecker Pipeline was successful Details

Reviewed-on: AkkomaGang/pleroma-fe#54
This commit is contained in:
floatingghost 2022-07-22 15:09:06 +00:00
commit 12d7e4ea24
1 changed files with 2 additions and 0 deletions

View File

@ -1440,6 +1440,8 @@ export const ProcessedWS = ({
export const handleMastoWS = (wsEvent) => {
const { data } = wsEvent
if (!data) return
if (data === 'pong') return
const parsedEvent = JSON.parse(data)
const { event, payload } = parsedEvent
if (MASTODON_STREAMING_EVENTS.has(event) || PLEROMA_STREAMING_EVENTS.has(event)) {