pleroma/packages/pl-fe/src/utils/quirks.ts
marcin mikołajczak 4d5690d0c1 Switch to workspace
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2024-08-28 13:01:08 +02:00

16 lines
486 B
TypeScript

import { getFeatures, MITRA, type Instance } from 'pl-api';
import { createSelector } from 'reselect';
/** For solving bugs between API implementations. */
const getQuirks = createSelector([
(instance: Instance) => getFeatures(instance).version,
], (v) => ({
/**
* Apps are not supported by the API, and should not be created during login or registration.
* @see POST /api/v1/apps
* @see POST /oauth/token
*/
noApps: v.software === MITRA,
}));
export { getQuirks };