aboutsummaryrefslogtreecommitdiffstats
path: root/web_src/js
diff options
context:
space:
mode:
authorwxiaoguang <wxiaoguang@gmail.com>2024-12-12 10:01:20 +0800
committerGitHub <noreply@github.com>2024-12-12 02:01:20 +0000
commit17f04114419bca0d20d2474cee61beb18e4caaa0 (patch)
tree28a72cb90d327dc142f0738b33d0e7dd57acd223 /web_src/js
parent1893b32670937e769a1f81001f5ad3122a737b9a (diff)
downloadgitea-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.ts6
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();
});