Handle CUSTOM_HOMEPAGE=false

This one's been broken for a while, but should only affect `yarn dev-server` and those who does not have access to the homepages.
This commit is contained in:
infinite-persistence 2022-05-23 15:39:36 +08:00
parent ceca6e3b84
commit 7d1992d541
No known key found for this signature in database
GPG key ID: B9C3252EDC3D0AA0

View file

@ -19,6 +19,10 @@ const loadAnnouncements = (homepageKeys) => {
// this didn't seem to help. // this didn't seem to help.
if (!memo.homepageData) { if (!memo.homepageData) {
if (process.env.CUSTOM_HOMEPAGE !== 'true') {
return;
}
try { try {
memo.homepageData = require('../../custom/homepages/v2'); memo.homepageData = require('../../custom/homepages/v2');
memo.announcements = loadAnnouncements(Object.keys(memo.homepageData)); memo.announcements = loadAnnouncements(Object.keys(memo.homepageData));