kopia lustrzana https://gitlab.com/soapbox-pub/soapbox
Features: focalPoint check
rodzic
8f532b1b92
commit
dfb133b22c
|
@ -108,4 +108,20 @@ describe('getFeatures', () => {
|
||||||
expect(features.attachmentLimit).toEqual(Infinity);
|
expect(features.attachmentLimit).toEqual(Infinity);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
describe('focalPoint', () => {
|
||||||
|
it('is true for Mastodon 2.3.0+', () => {
|
||||||
|
const instance = ImmutableMap({ version: '2.3.0' });
|
||||||
|
const features = getFeatures(instance);
|
||||||
|
expect(features.focalPoint).toBe(true);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('is false for Pleroma', () => {
|
||||||
|
const instance = ImmutableMap({
|
||||||
|
version: '2.7.2 (compatible; Pleroma 1.1.50-42-g3d9ac6ae-develop)',
|
||||||
|
});
|
||||||
|
const features = getFeatures(instance);
|
||||||
|
expect(features.focalPoint).toBe(false);
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -8,6 +8,7 @@ export const getFeatures = instance => {
|
||||||
trends: v.software === 'Mastodon' && semver.gte(v.compatVersion, '3.0.0'),
|
trends: v.software === 'Mastodon' && semver.gte(v.compatVersion, '3.0.0'),
|
||||||
emojiReacts: v.software === 'Pleroma' && semver.gte(v.version, '2.0.0'),
|
emojiReacts: v.software === 'Pleroma' && semver.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'),
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue