diff options
author | wxiaoguang <wxiaoguang@gmail.com> | 2024-12-12 10:01:20 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-12-12 02:01:20 +0000 |
commit | 17f04114419bca0d20d2474cee61beb18e4caaa0 (patch) | |
tree | 28a72cb90d327dc142f0738b33d0e7dd57acd223 /web_src/js | |
parent | 1893b32670937e769a1f81001f5ad3122a737b9a (diff) | |
download | gitea-17f04114419bca0d20d2474cee61beb18e4caaa0.tar.gz gitea-17f04114419bca0d20d2474cee61beb18e4caaa0.zip |
Fix clone panel js error (#32798)
side effect of jquery removal, fix #32797
Diffstat (limited to 'web_src/js')
-rw-r--r-- | web_src/js/features/repo-common.ts | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/web_src/js/features/repo-common.ts b/web_src/js/features/repo-common.ts index 40932f6667..90860720e4 100644 --- a/web_src/js/features/repo-common.ts +++ b/web_src/js/features/repo-common.ts @@ -75,12 +75,12 @@ function initCloneSchemeUrlSelection(parent: Element) { }; updateClonePanelUi(); - - tabSsh.addEventListener('click', () => { + // tabSsh or tabHttps might not both exist, eg: guest view, or one is disabled by the server + tabSsh?.addEventListener('click', () => { localStorage.setItem('repo-clone-protocol', 'ssh'); updateClonePanelUi(); }); - tabHttps.addEventListener('click', () => { + tabHttps?.addEventListener('click', () => { localStorage.setItem('repo-clone-protocol', 'https'); updateClonePanelUi(); }); |