mirror of
https://github.com/recloudstream/website.git
synced 2024-08-15 03:18:45 +00:00
use window.RepoApi when avaliable
This commit is contained in:
parent
bd6d994c6c
commit
8d257ca73d
1 changed files with 8 additions and 3 deletions
|
@ -29,8 +29,13 @@ const RepoCard = ({ url, isFirst }) => {
|
||||||
autoFocus={isFirst}
|
autoFocus={isFirst}
|
||||||
group={true}
|
group={true}
|
||||||
className="btn-primary"
|
className="btn-primary"
|
||||||
href={`cloudstreamrepo://${url.replace(/^https?:\/\//, "")}`}
|
onClick={() => {
|
||||||
target="_blank"
|
if (window.RepoApi !== undefined) {
|
||||||
|
window.RepoApi.installRepo(url)
|
||||||
|
} else {
|
||||||
|
window.open(`cloudstreamrepo://${url.replace(/^https?:\/\//, "")}`)
|
||||||
|
}
|
||||||
|
}}
|
||||||
>Install</CompatBtn>
|
>Install</CompatBtn>
|
||||||
<CompatBtn group={true}
|
<CompatBtn group={true}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
|
@ -51,4 +56,4 @@ const RepoCard = ({ url, isFirst }) => {
|
||||||
</article>
|
</article>
|
||||||
}
|
}
|
||||||
|
|
||||||
export default RepoCard
|
export default RepoCard
|
||||||
|
|
Loading…
Reference in a new issue