Skip to content

Commit

Permalink
Merge branch 'develop' into feature/migrate-nimbus-to-2-services
Browse files Browse the repository at this point in the history
  • Loading branch information
dappnodedev authored Sep 4, 2024
2 parents 5a7554d + 0cd19c5 commit 1dd2918
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from "react";
import { useApi } from "api";
import { useSelector } from "react-redux";
import { useParams } from "react-router-dom";
import { useParams, useSearchParams } from "react-router-dom";
import { title } from "../data";
// This module
import InstallDnpView from "./InstallDnpView";
Expand All @@ -13,7 +13,9 @@ import ErrorView from "components/ErrorView";
import { getProgressLogsByDnp } from "services/isInstallingLogs/selectors";

const InstallDnpContainer: React.FC = () => {
const { id, version } = useParams<{ id: string; version: string }>();
const { id } = useParams<{ id: string }>();
const [searchParams] = useSearchParams();
const version = searchParams.get("version") || undefined;
const progressLogsByDnp = useSelector(getProgressLogsByDnp);

// TODO: return a beautiful error page
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ const InstallerRoot: React.FC = () => {
element={
<Routes>
<Route index element={<route.component />} />
<Route path=":id/:version?/*" element={<InstallDnpContainer />} />
<Route path=":id/*" element={<InstallDnpContainer />} />
</Routes>
}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export const InstallerDnp: React.FC = () => {
const encodedDnpName = encodeURIComponent(dnpName);
const encodedVersion = version ? encodeURIComponent(version) : null;

const pkgPath = encodedVersion ? `${encodedDnpName}/${encodedVersion}` : encodedDnpName;
const pkgPath = encodedVersion ? `${encodedDnpName}?version=${encodedVersion}` : encodedDnpName;

navigate(pkgPath);
}
Expand Down

0 comments on commit 1dd2918

Please sign in to comment.