GoToSocial support
This commit is contained in:
parent
eb3fc815d9
commit
fb7c642dc7
|
@ -61,6 +61,7 @@ export function fetchInstance() {
|
||||||
dispatch(fetchNodeinfo()); // Pleroma < 2.1 backwards compatibility
|
dispatch(fetchNodeinfo()); // Pleroma < 2.1 backwards compatibility
|
||||||
}
|
}
|
||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
|
console.error(error);
|
||||||
dispatch({ type: INSTANCE_FETCH_FAIL, error, skipAlert: true });
|
dispatch({ type: INSTANCE_FETCH_FAIL, error, skipAlert: true });
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
|
@ -28,6 +28,8 @@ export default class Avatar extends React.PureComponent {
|
||||||
height: `${size}px`,
|
height: `${size}px`,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Only render the image if src is provided
|
||||||
|
if (account.get('avatar')) {
|
||||||
return (
|
return (
|
||||||
<StillImage
|
<StillImage
|
||||||
className={classNames('account__avatar', { 'account__avatar-inline': inline })}
|
className={classNames('account__avatar', { 'account__avatar-inline': inline })}
|
||||||
|
@ -36,6 +38,12 @@ export default class Avatar extends React.PureComponent {
|
||||||
alt=''
|
alt=''
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
} else {
|
||||||
|
// Fall back on rendering an empty div
|
||||||
|
return (
|
||||||
|
<div className={classNames('account__avatar', { 'account__avatar-inline': inline })} style={style} />
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -89,9 +89,20 @@ export const getFeatures = createSelector([
|
||||||
export const parseVersion = version => {
|
export const parseVersion = version => {
|
||||||
const regex = /^([\w\.]*)(?: \(compatible; ([\w]*) (.*)\))?$/;
|
const regex = /^([\w\.]*)(?: \(compatible; ([\w]*) (.*)\))?$/;
|
||||||
const match = regex.exec(version);
|
const match = regex.exec(version);
|
||||||
|
|
||||||
|
if (match) {
|
||||||
return {
|
return {
|
||||||
software: match[2] || MASTODON,
|
software: match[2] || MASTODON,
|
||||||
version: match[3] || match[1],
|
version: match[3] || match[1],
|
||||||
compatVersion: match[1],
|
compatVersion: match[1],
|
||||||
};
|
};
|
||||||
|
} else {
|
||||||
|
// If we can't parse the version, this is a new and exotic backend.
|
||||||
|
// Fall back to minimal featureset.
|
||||||
|
return {
|
||||||
|
software: null,
|
||||||
|
version: '0.0.0',
|
||||||
|
compatVersion: '0.0.0',
|
||||||
|
};
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue