Skip to content

Commit

Permalink
Allow searching in Dappstore with :version
Browse files Browse the repository at this point in the history
  • Loading branch information
dappnodedev committed Aug 14, 2024
1 parent 029563d commit 37496c8
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,17 @@ export const InstallerDnp: React.FC = routeProps => {
}
]
});
} else navigate(encodeURIComponent(id));
} else {
// Check if version has been defined like dnpName:version
const [dnpName, version] = id.split(":");

const encodedDnpName = encodeURIComponent(dnpName);
const encodedVersion = version ? encodeURIComponent(version) : null;

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

navigate(pkgPath);
}
}

function onCategoryChange(category: string) {
Expand Down

0 comments on commit 37496c8

Please sign in to comment.