2022-02-10 14:33:28 -08:00
|
|
|
import { createSelector } from 'reselect';
|
|
|
|
|
|
|
|
import { parseVersion, PLEROMA, MITRA } from './features';
|
2021-03-30 09:53:45 -07:00
|
|
|
|
|
|
|
// For solving bugs between API implementations
|
2022-02-10 14:33:28 -08:00
|
|
|
export const getQuirks = createSelector([
|
|
|
|
instance => parseVersion(instance.get('version')),
|
|
|
|
], (v) => {
|
2021-03-30 09:53:45 -07:00
|
|
|
return {
|
2022-02-10 14:33:28 -08:00
|
|
|
invertedPagination: v.software === PLEROMA,
|
2022-02-10 17:34:23 -08:00
|
|
|
noApps: v.software === MITRA,
|
|
|
|
noOAuthForm: v.software === MITRA,
|
2021-03-30 09:53:45 -07:00
|
|
|
};
|
2022-02-10 14:33:28 -08:00
|
|
|
});
|
2021-03-30 09:53:45 -07:00
|
|
|
|
|
|
|
export const getNextLinkName = getState =>
|
|
|
|
getQuirks(getState().get('instance')).invertedPagination ? 'prev' : 'next';
|