Skip to content
Snippets Groups Projects
Commit 36e56354 authored by feld's avatar feld
Browse files

More robust backwards compatibility

parent 9656c9b9
No related branches found
No related tags found
No related merge requests found
......@@ -188,9 +188,12 @@ export const parseUser = (data) => {
output.follow_request_count = data.pleroma.follow_request_count
output.tags = data.pleroma.tags
// deactivated was changed to is_active in Pleroma 2.3.0
// backwards compatability kept for now
output.deactivated = data.pleroma.deactivated ? !data.pleroma.is_active : data.pleroma.deactivated
// so check if is_active is present
output.deactivated = typeof data.pleroma.is_active !== undefined
? !data.pleroma.is_active // new backend
: data.pleroma.deactivated // old backend
output.notification_settings = data.pleroma.notification_settings
output.unread_chat_count = data.pleroma.unread_chat_count
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment