diff --git a/web_src/js/features/repo-template.ts b/web_src/js/features/repo-template.ts index 0a689e803f..f3d79eba80 100644 --- a/web_src/js/features/repo-template.ts +++ b/web_src/js/features/repo-template.ts @@ -6,6 +6,8 @@ const {appSubUrl} = window.config; export function initRepoTemplateSearch() { const $repoTemplate = $('#repo_template'); + if (!$repoTemplate.length) return; // make sure the current page is "new repo" page + const checkTemplate = function () { const $templateUnits = $('#template_units'); const $nonTemplate = $('#non_template');