EmailList: let csv links be clickable, add combined.csv support, conditionally display elements

This commit is contained in:
Alex Gleason
2021-06-15 15:02:36 -05:00
parent 6255ba4976
commit eb006202e7
6 changed files with 81 additions and 7 deletions

View File

@ -1,8 +1,10 @@
// Detect backend features to conditionally render elements
import gte from 'semver/functions/gte';
import { List as ImmutableList } from 'immutable';
export const getFeatures = instance => {
const v = parseVersion(instance.get('version'));
const f = instance.getIn(['pleroma', 'metadata', 'features'], ImmutableList());
return {
suggestions: v.software === 'Mastodon' && gte(v.compatVersion, '2.4.3'),
trends: v.software === 'Mastodon' && gte(v.compatVersion, '3.0.0'),
@ -11,6 +13,7 @@ export const getFeatures = instance => {
attachmentLimit: v.software === 'Pleroma' ? Infinity : 4,
focalPoint: v.software === 'Mastodon' && gte(v.compatVersion, '2.3.0'),
importMutes: v.software === 'Pleroma' && gte(v.version, '2.2.0'),
emailList: f.includes('email_list'),
};
};