sforkowany z mirror/soapbox
Merge branch 'reduce-semver' into 'develop'
Reduce semver bundle size, #439 See merge request soapbox-pub/soapbox-fe!267chats_paste
commit
8fcc53dfa7
|
@ -1,14 +1,14 @@
|
||||||
// Detect backend features to conditionally render elements
|
// Detect backend features to conditionally render elements
|
||||||
import semver from 'semver';
|
import gte from 'semver/functions/gte';
|
||||||
|
|
||||||
export const getFeatures = instance => {
|
export const getFeatures = instance => {
|
||||||
const v = parseVersion(instance.get('version'));
|
const v = parseVersion(instance.get('version'));
|
||||||
return {
|
return {
|
||||||
suggestions: v.software === 'Mastodon' && semver.gte(v.compatVersion, '2.4.3'),
|
suggestions: v.software === 'Mastodon' && gte(v.compatVersion, '2.4.3'),
|
||||||
trends: v.software === 'Mastodon' && semver.gte(v.compatVersion, '3.0.0'),
|
trends: v.software === 'Mastodon' && gte(v.compatVersion, '3.0.0'),
|
||||||
emojiReacts: v.software === 'Pleroma' && semver.gte(v.version, '2.0.0'),
|
emojiReacts: v.software === 'Pleroma' && gte(v.version, '2.0.0'),
|
||||||
attachmentLimit: v.software === 'Pleroma' ? Infinity : 4,
|
attachmentLimit: v.software === 'Pleroma' ? Infinity : 4,
|
||||||
focalPoint: v.software === 'Mastodon' && semver.gte(v.compatVersion, '2.3.0'),
|
focalPoint: v.software === 'Mastodon' && gte(v.compatVersion, '2.3.0'),
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue