fix: default comment provider not displaying

This commit is contained in:
NGPixel 2022-04-29 19:36:47 -04:00
parent 3407ac8829
commit 13890a92ab
No known key found for this signature in database
GPG Key ID: 8FDA2F1757F60D63

View File

@ -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 }