Ensure isSSH is set whenever DISABLE_HTTP_GIT is set (#19028)
When DISABLE_HTTP_GIT is set we should always show the SSH button
This commit is contained in:
parent
ea46142bce
commit
c21735b49a
1 changed files with 19 additions and 12 deletions
|
@ -19,8 +19,14 @@
|
|||
</button>
|
||||
{{end}}
|
||||
{{if not (and $.DisableHTTP $.DisableSSH)}}
|
||||
<script defer>
|
||||
const isSSH = localStorage.getItem('repo-clone-protocol') === 'ssh';
|
||||
<script>
|
||||
<!-- /* eslint-disable */ -->
|
||||
window.config.pageData['repoCloneButtons']= {httpsDisabled: {{$.DisableHTTP}}};
|
||||
</script>
|
||||
<script>
|
||||
(() => {
|
||||
const tmplData = window.config.pageData.repoCloneButtons;
|
||||
const isSSH = tmplData.httpsDisabled || localStorage.getItem('repo-clone-protocol') === 'ssh';
|
||||
const sshButton = document.getElementById('repo-clone-ssh');
|
||||
const httpsButton = document.getElementById('repo-clone-https');
|
||||
const input = document.getElementById('repo-clone-url');
|
||||
|
@ -31,5 +37,6 @@
|
|||
if (sshButton) sshButton.classList.remove('no-transition');
|
||||
if (httpsButton) httpsButton.classList.remove('no-transition');
|
||||
}, 100);
|
||||
})();
|
||||
</script>
|
||||
{{end}}
|
||||
|
|
Loading…
Reference in a new issue