Fix: externalLink might be null

This commit is contained in:
eight 2017-09-25 18:21:11 +08:00
parent cb7aaa7111
commit 587feb3817

View File

@ -127,7 +127,7 @@
cm.setPreprocessor(data.preprocessor);
// update metas
document.title = data.name;
document.title = `${installButtonLabel()} ${data.name}`;
$('.install').textContent = installButtonLabel();
$('.set-update-url').title = dup && dup.updateUrl && t('installUpdateFrom', dup.updateUrl) || '';
@ -150,9 +150,12 @@
$('.applies-to').appendChild($element({tag: 'li', textContent: pattern}))
);
$('.external-link').appendChild(externalLink());
const externalLink = makeExternalLink();
if (externalLink) {
$('.external-link').appendChild();
}
function externalLink() {
function makeExternalLink() {
const urls = [];
if (data.homepageURL) {
urls.push([data.homepageURL, t('externalHomepage')]);