Features: add attachmentLimit check
This commit is contained in:
parent
cc6aae5937
commit
75412ca078
|
@ -92,4 +92,20 @@ describe('getFeatures', () => {
|
|||
expect(features.trends).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
describe('attachmentLimit', () => {
|
||||
it('is 4 by default', () => {
|
||||
const instance = ImmutableMap({ version: '3.1.4' });
|
||||
const features = getFeatures(instance);
|
||||
expect(features.attachmentLimit).toEqual(4);
|
||||
});
|
||||
|
||||
it('is Infinity for Pleroma', () => {
|
||||
const instance = ImmutableMap({
|
||||
version: '2.7.2 (compatible; Pleroma 1.1.50-42-g3d9ac6ae-develop)',
|
||||
});
|
||||
const features = getFeatures(instance);
|
||||
expect(features.attachmentLimit).toEqual(Infinity);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
@ -7,6 +7,7 @@ export const getFeatures = instance => {
|
|||
suggestions: v.software === 'Mastodon' && semver.gte(v.compatVersion, '2.4.3'),
|
||||
trends: v.software === 'Mastodon' && semver.gte(v.compatVersion, '3.0.0'),
|
||||
emojiReacts: v.software === 'Pleroma' && semver.gte(v.version, '2.0.0'),
|
||||
attachmentLimit: v.software === 'Pleroma' ? Infinity : 4,
|
||||
};
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue