0
0
mirror of https://github.com/go-gitea/gitea.git synced 2026-06-17 20:27:10 +02:00

Merge d6353c2da11de1a3e10e2184cfeca97d3381b7a3 into 68692e19d40894cf0c036f986f659b7ed9b298f5

This commit is contained in:
yszl666 2026-06-18 01:14:11 +09:00 committed by GitHub
commit d4fd6988cd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 1 deletions

View File

@ -32,6 +32,8 @@ const onItemClick = (e: MouseEvent) => {
// - the user didn't press any special key like "Ctrl+Click" (which may have custom browser behavior)
// - the editor/commit form isn't dirty (a full page reload shows a confirmation dialog if the form contains unsaved changes)
if (!isPlainClick(e) || shouldTriggerAreYouSure()) return;
// submodules (commit entry mode) point to external repos, let the browser handle navigation normally
if (props.item.entryMode === 'commit') return;
e.preventDefault();
if (props.item.entryMode === 'tree') doLoadChildren();
store.navigateTreeView(props.item.fullPath);

View File

@ -41,7 +41,8 @@ export function createViewFileTreeStore(props: {repoLink: string, treePath: stri
const u = new URL(url, window.origin);
u.searchParams.set('only_content', 'true');
const response = await GET(u.href);
const elViewContent = document.querySelector('.repo-view-content')!;
const elViewContent = document.querySelector('.repo-view-content');
if (!elViewContent) return;
elViewContent.innerHTML = await response.text();
const elViewContentData = elViewContent.querySelector('.repo-view-content-data');
if (!elViewContentData) return; // if error occurs, there is no such element