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.
28 lines
969 B
TypeScript
28 lines
969 B
TypeScript
import { createSlice, type PayloadAction } from '@reduxjs/toolkit';
|
|
import { DURATION } from '../../session/constants';
|
|
|
|
// FIXME update this to the correct timestamp REMOVE AFTER QA
|
|
export const LEGACY_GROUP_DEPRECATED_TIMESTAMP_MS = Date.now() + DURATION.WEEKS * 52;
|
|
|
|
export interface ReleasedFeaturesState {
|
|
legacyGroupDeprecationTimestampRefreshAtMs: number;
|
|
}
|
|
|
|
export const initialReleasedFeaturesState = {
|
|
legacyGroupDeprecationTimestampRefreshAtMs: Date.now(),
|
|
};
|
|
|
|
const releasedFeaturesSlice = createSlice({
|
|
name: 'releasedFeatures',
|
|
initialState: initialReleasedFeaturesState,
|
|
reducers: {
|
|
updateLegacyGroupDeprecationTimestampUpdatedAt: (state, action: PayloadAction<number>) => {
|
|
state.legacyGroupDeprecationTimestampRefreshAtMs = action.payload;
|
|
},
|
|
},
|
|
});
|
|
|
|
const { actions, reducer } = releasedFeaturesSlice;
|
|
export const { updateLegacyGroupDeprecationTimestampUpdatedAt } = actions;
|
|
export const releasedFeaturesReducer = reducer;
|