From 8d257ca73d7c208a4944b08e00488e4dbbc3a532 Mon Sep 17 00:00:00 2001 From: Cloudburst <18114966+C10udburst@users.noreply.github.com> Date: Sat, 10 Sep 2022 19:36:53 +0200 Subject: [PATCH] use window.RepoApi when avaliable --- src/components/cards/repo.jsx | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/components/cards/repo.jsx b/src/components/cards/repo.jsx index aca0863..70834ff 100644 --- a/src/components/cards/repo.jsx +++ b/src/components/cards/repo.jsx @@ -29,8 +29,13 @@ const RepoCard = ({ url, isFirst }) => { autoFocus={isFirst} group={true} className="btn-primary" - href={`cloudstreamrepo://${url.replace(/^https?:\/\//, "")}`} - target="_blank" + onClick={() => { + if (window.RepoApi !== undefined) { + window.RepoApi.installRepo(url) + } else { + window.open(`cloudstreamrepo://${url.replace(/^https?:\/\//, "")}`) + } + }} >Install { @@ -51,4 +56,4 @@ const RepoCard = ({ url, isFirst }) => { } -export default RepoCard \ No newline at end of file +export default RepoCard