pleroma/src/utils/quirks.ts

21 lines
560 B
TypeScript
Raw Normal View History

2022-04-24 12:28:07 -07:00
/* eslint sort-keys: "error" */
import { createSelector } from 'reselect';
import { parseVersion, MITRA } from './features';
2022-04-24 12:28:07 -07:00
2023-09-23 18:41:24 -07:00
import type { Instance } from 'soapbox/schemas';
2022-04-24 12:28:07 -07:00
/** For solving bugs between API implementations. */
const getQuirks = createSelector([
2022-04-24 12:28:07 -07:00
(instance: Instance) => parseVersion(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,
}));
2022-04-24 12:28:07 -07:00
export { getQuirks };