mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-12-15 21:10:22 +01:00
fix: #13776, if plugin is in install/package.json use latest version from there
otherwise show latest version from nbbpm
This commit is contained in:
@@ -194,7 +194,7 @@ Plugins.listTrending = async () => {
|
||||
|
||||
Plugins.normalise = async function (apiReturn) {
|
||||
const pluginMap = {};
|
||||
const { dependencies } = require(paths.currentPackage);
|
||||
const { dependencies } = require(paths.installPackage);
|
||||
apiReturn = Array.isArray(apiReturn) ? apiReturn : [];
|
||||
apiReturn.forEach((packageData) => {
|
||||
packageData.id = packageData.name;
|
||||
@@ -229,7 +229,7 @@ Plugins.normalise = async function (apiReturn) {
|
||||
pluginMap[plugin.id].settingsRoute = plugin.settingsRoute;
|
||||
pluginMap[plugin.id].license = plugin.license;
|
||||
|
||||
// If package.json defines a version to use, stick to that
|
||||
// If install/package.json defines a version to use, stick to that
|
||||
if (dependencies.hasOwnProperty(plugin.id) && semver.valid(dependencies[plugin.id])) {
|
||||
pluginMap[plugin.id].latest = dependencies[plugin.id];
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user