Skip to content

Commit

Permalink
change href to history
Browse files Browse the repository at this point in the history
  • Loading branch information
bprize15 committed Nov 7, 2024
1 parent f31b3a3 commit 17a4064
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/main/webapp/app/pages/curation/GeneListPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { IRootStore } from 'app/stores';
import { Col, Row } from 'reactstrap';
import LoadingIndicator, { LoaderSize } from 'app/oncokb-commons/components/loadingIndicator/LoadingIndicator';
import { createGeneIfDoesNotExist, geneNeedsReview } from 'app/shared/util/firebase/firebase-utils';
import { Link, RouteComponentProps, generatePath } from 'react-router-dom';
import { Link, RouteComponentProps, generatePath, useHistory } from 'react-router-dom';
import { APP_DATETIME_FORMAT, GERMLINE_PATH, PAGE_ROUTE } from 'app/config/constants/constants';
import OncoKBTable, { SearchColumn } from 'app/shared/table/OncoKBTable';
import { filterByKeyword } from 'app/shared/util/utils';
Expand Down Expand Up @@ -34,6 +34,8 @@ type GeneMetaInfo = {
export interface IGeneListPage extends StoreProps, RouteComponentProps {}

const GeneListPage = (props: IGeneListPage) => {
const history = useHistory();

const pathname = props.location.pathname;
const isGermline = pathname.includes(GERMLINE_PATH);

Expand Down Expand Up @@ -78,7 +80,7 @@ const GeneListPage = (props: IGeneListPage) => {
if (props.firebaseDb) {
try {
await createGeneIfDoesNotExist(cell.value, isGermline, props.firebaseDb, props.createGene);
window.location.href = link;
history.push(link);
} catch (error) {
notifyError(error);
}
Expand Down

0 comments on commit 17a4064

Please sign in to comment.