浏览代码

fix: default comment provider not displaying

NGPixel 3 年之前
父节点
当前提交
948157745f
共有 1 个文件被更改,包括 2 次插入8 次删除
  1. 2 8
      server/controllers/common.js

+ 2 - 8
server/controllers/common.js

@@ -525,19 +525,13 @@ router.get('/*', async (req, res, next) => {
           }
 
           // -> Inject comments variables
-          const shouldDisplayComments = WIKI.config.features.featurePageComments && WIKI.data.commentProvider.codeTemplate
-          const commentTmpl = shouldDisplayComments ? {
+          const commentTmpl = {
             codeTemplate: WIKI.data.commentProvider.codeTemplate,
             head: WIKI.data.commentProvider.head,
             body: WIKI.data.commentProvider.body,
             main: WIKI.data.commentProvider.main
-          } : {
-            codeTemplate: false,
-            head: null,
-            body: null,
-            main: ''
           }
-          if (shouldDisplayComments) {
+          if (WIKI.config.features.featurePageComments && WIKI.data.commentProvider.codeTemplate) {
             [
               { key: 'pageUrl', value: `${WIKI.config.host}/i/${page.id}` },
               { key: 'pageId', value: page.id }