use window.RepoApi when avaliable

This commit is contained in:
Cloudburst 2022-09-10 19:36:53 +02:00 committed by GitHub
parent bd6d994c6c
commit 8d257ca73d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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