Skip to content

Commit

Permalink
remove validation flag (#4464)
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicole Zonnenberg authored Jan 5, 2023
1 parent 82959f5 commit dcb0343
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions web/src/containers/Root.js
Original file line number Diff line number Diff line change
@@ -1,25 +1,14 @@
import React, { useEffect } from 'react';
import React from 'react';
import PropTypes from 'prop-types';
import { Provider } from 'react-redux';
import { ConnectedRouter } from 'connected-react-router';
import { withLDProvider, useFlags } from 'launchdarkly-react-client-sdk';
import { withLDProvider } from 'launchdarkly-react-client-sdk';

import { setLatestActivity } from '../redux/actions/auth';
import { updateFlags } from '../redux/actions/flags';

import App from './App';

const Root = ({ history, store }) => {
// when the app opens, get all of the flags
// update the flags you are watching here
const { validation = true } = useFlags();

// use the updateFlags action if a reducer needs to use a flag
// then it can listen for the FLAGS_UPDATED type
useEffect(() => {
store.dispatch(updateFlags({ validation }));
}, [validation]); // eslint-disable-line react-hooks/exhaustive-deps

// Create listener for location changing to track activity
history.listen(() => {
store.dispatch(setLatestActivity());
Expand Down

0 comments on commit dcb0343

Please sign in to comment.