diff --git a/web_src/js/components/ViewFileTreeStore.ts b/web_src/js/components/ViewFileTreeStore.ts index 013d83e000..6f46d12e9b 100644 --- a/web_src/js/components/ViewFileTreeStore.ts +++ b/web_src/js/components/ViewFileTreeStore.ts @@ -30,8 +30,9 @@ export function createViewFileTreeStore(props: {repoLink: string, treePath: stri const response = await GET(u.href); const elViewContent = document.querySelector('.repo-view-content'); elViewContent.innerHTML = await response.text(); - const t1 = elViewContent.querySelector('.repo-view-content-data').getAttribute('data-document-title'); - const t2 = elViewContent.querySelector('.repo-view-content-data').getAttribute('data-document-title-common'); + const elViewContentData = elViewContent.querySelector('.repo-view-content-data'); + const t1 = elViewContentData.getAttribute('data-document-title'); + const t2 = elViewContentData.getAttribute('data-document-title-common'); document.title = `${t1} - ${t2}`; // follow the format in head.tmpl: