You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
session-desktop/ts/state/selectors/releasedFeatures.ts

21 lines
680 B
TypeScript

import { useSelector } from 'react-redux';
import { NetworkTime } from '../../util/NetworkTime';
import { LEGACY_GROUP_DEPRECATED_TIMESTAMP_MS } from '../ducks/releasedFeatures';
export const areLegacyGroupsDeprecatedYet = (): boolean => {
const theyAreDeprecated = NetworkTime.now() >= LEGACY_GROUP_DEPRECATED_TIMESTAMP_MS;
return window.sessionFeatureFlags.forceLegacyGroupsDeprecated || theyAreDeprecated;
};
export function areLegacyGroupsDeprecatedYetOutsideRedux() {
if (!window.inboxStore) {
return false;
}
return areLegacyGroupsDeprecatedYet();
}
export function useAreLegacyGroupsDeprecatedYet() {
return useSelector(areLegacyGroupsDeprecatedYet);
}