Node.js based forum software built for the modern web
fix: use package.name for theme.id (#8965)
Peter Jaszkowiakba3981e270de
diff --git a/src/meta/themes.js b/src/meta/themes.jsindex 8c184f776d..1120591609 100644--- a/src/meta/themes.js+++ b/src/meta/themes.js@@ -25,9 +25,16 @@ Themes.get = async () => {themes = _.flatten(themes).filter(Boolean);themes = await Promise.all(themes.map(async (theme) => {const config = path.join(themePath, theme, 'theme.json');+ const pack = path.join(themePath, theme, 'package.json');try {- const file = await fs.promises.readFile(config, 'utf8');- const configObj = JSON.parse(file);+ const [configFile, packageFile] = await Promise.all([+ fs.promises.readFile(config, 'utf8'),+ fs.promises.readFile(pack, 'utf8'),+ ]);+ const configObj = JSON.parse(configFile);+ const packageObj = JSON.parse(packageFile);++ configObj.id = packageObj.name;// Minor adjustments for API outputconfigObj.type = 'local';