Skip to content

Commit

Permalink
intially fetch url version instead of default version
Browse files Browse the repository at this point in the history
  • Loading branch information
bprize15 committed Dec 12, 2024
1 parent d3df2a6 commit 2ff23ac
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions web/src/main/javascript/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import About from "./pages/About/About";

function App() {
const location = useLocation();
const [, setSearchParams] = useSearchParams();
const [searchParams, setSearchParams] = useSearchParams();

const [oncoTreeData, setOncoTreeData] = useState<OncoTreeNode>();
const [oncoTree, setOncoTree] = useState<OncoTree>();
Expand All @@ -33,7 +33,12 @@ function App() {
}

useEffect(() => {
fetchData(DEFAULT_VERSION);
const version = searchParams.get('version');
if (version) {
fetchData(version);
} else {
fetchData(DEFAULT_VERSION);
}
}, []);

Check warning on line 42 in web/src/main/javascript/src/App.tsx

View workflow job for this annotation

GitHub Actions / build

React Hook useEffect has a missing dependency: 'searchParams'. Either include it or remove the dependency array

Check warning on line 42 in web/src/main/javascript/src/App.tsx

View workflow job for this annotation

GitHub Actions / build

React Hook useEffect has a missing dependency: 'searchParams'. Either include it or remove the dependency array

useEffect(() => {
Expand Down

0 comments on commit 2ff23ac

Please sign in to comment.