Merge branch 'issue_124' into 'develop'

Change 403 messaging

See merge request pleroma/pleroma-fe!1020
This commit is contained in:
feld 2019-12-13 17:02:09 +00:00
commit 749a399944
5 changed files with 48 additions and 10 deletions

View file

@ -529,16 +529,24 @@ const fetchTimeline = ({
const queryString = map(params, (param) => `${param[0]}=${param[1]}`).join('&')
url += `?${queryString}`
let status = ''
let statusText = ''
return fetch(url, { headers: authHeaders(credentials) })
.then((data) => {
if (data.ok) {
return data
}
throw new Error('Error fetching timeline', data)
status = data.status
statusText = data.statusText
return data
})
.then((data) => data.json())
.then((data) => data.map(isNotifications ? parseNotification : parseStatus))
.then((data) => {
if (!data.error) {
return data.map(isNotifications ? parseNotification : parseStatus)
} else {
data.status = status
data.statusText = statusText
return data
}
})
}
const fetchPinnedStatuses = ({ id, credentials }) => {