notifications now also undergo some parsing, hypothetically could use MastoAPI

notifications, maybe.
This commit is contained in:
Henry Jameson 2019-01-14 22:38:37 +03:00
parent e0fd6d12ed
commit 790fcf37d2
4 changed files with 53 additions and 32 deletions

View file

@ -44,7 +44,7 @@ const SUGGESTIONS_URL = '/api/v1/suggestions'
const MASTODON_USER_FAVORITES_TIMELINE_URL = '/api/v1/favourites'
import { each, map } from 'lodash'
import { parseStatus, parseUser } from '../status_normalizer/status_normalizer.service.js'
import { parseStatus, parseUser, parseNotification } from '../status_normalizer/status_normalizer.service.js'
import 'whatwg-fetch'
const oldfetch = window.fetch
@ -347,7 +347,7 @@ const fetchTimeline = ({timeline, credentials, since = false, until = false, use
throw new Error('Error fetching timeline')
})
.then((data) => data.json())
.then((data) => data.map(isNotifications ? _ => _ : parseStatus))
.then((data) => data.map(isNotifications ? parseNotification : parseStatus))
}
const verifyCredentials = (user) => {