Skip to content

Commit

Permalink
Refactor: Replace browserHistory.push with window.location.assign to …
Browse files Browse the repository at this point in the history
…force a auto-refresh (#2175)

Fixed issue where adding an imported fact-check (FC) did not update or display the FC in the left panel immediately. A page refresh was required to see the changes.

Reference: CV2-5506
  • Loading branch information
danielevalverde authored Oct 31, 2024
1 parent 7a42dcc commit b07ee99
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/app/components/media/Similarity/MediaSimilarityBarAdd.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import PropTypes from 'prop-types';
import { FormattedMessage } from 'react-intl';
import { graphql, commitMutation } from 'react-relay/compat';
import { Store } from 'react-relay/classic';
import { browserHistory } from 'react-router';
import ButtonMain from '../../cds/buttons-checkboxes-chips/ButtonMain';
import Tooltip from '../../cds/alerts-and-prompts/Tooltip';
import CreateRelatedMediaDialog from '../CreateRelatedMediaDialog';
Expand Down Expand Up @@ -39,7 +38,7 @@ const MediaSimilarityBarAdd = ({
setShowDialog(false);
const teamSlug = window.location.pathname.match(/^\/([^/]+)/)[1];
const mediaUrl = `/${teamSlug}/media/${mainItemDbid}`;
browserHistory.push(mediaUrl);
window.location.assign(mediaUrl);
};

const handleAdd = (projectMedia) => {
Expand Down

0 comments on commit b07ee99

Please sign in to comment.