mirror of
				https://github.com/NodeBB/NodeBB.git
				synced 2025-10-31 11:05:54 +01:00 
			
		
		
		
	feat: show even uninstalled active plugins if set via config
This commit is contained in:
		| @@ -15,8 +15,8 @@ pluginsController.get = async function (req, res) { | |||||||
| 	]); | 	]); | ||||||
|  |  | ||||||
| 	const compatiblePkgNames = compatible.map(pkgData => pkgData.name); | 	const compatiblePkgNames = compatible.map(pkgData => pkgData.name); | ||||||
| 	const installedPlugins = compatible.filter(plugin => plugin && plugin.installed); | 	const installedPlugins = compatible.filter(plugin => plugin && (plugin.installed || (nconf.get('plugins:active') && plugin.active))); | ||||||
| 	const activePlugins = all.filter(plugin => plugin && plugin.installed && plugin.active); | 	const activePlugins = all.filter(plugin => plugin && (plugin.installed || nconf.get('plugins:active')) && plugin.active); | ||||||
|  |  | ||||||
| 	const trendingScores = trending.reduce((memo, cur) => { | 	const trendingScores = trending.reduce((memo, cur) => { | ||||||
| 		memo[cur.label] = cur.value; | 		memo[cur.label] = cur.value; | ||||||
|   | |||||||
| @@ -234,6 +234,13 @@ Plugins.normalise = async function (apiReturn) { | |||||||
| 		pluginMap[plugin.id].outdated = semver.gt(pluginMap[plugin.id].latest, pluginMap[plugin.id].version); | 		pluginMap[plugin.id].outdated = semver.gt(pluginMap[plugin.id].latest, pluginMap[plugin.id].version); | ||||||
| 	}); | 	}); | ||||||
|  |  | ||||||
|  | 	if (nconf.get('plugins:active')) { | ||||||
|  | 		nconf.get('plugins:active').forEach((id) => { | ||||||
|  | 			pluginMap[id] = pluginMap[id] || {}; | ||||||
|  | 			pluginMap[id].active = true; | ||||||
|  | 		}); | ||||||
|  | 	} | ||||||
|  |  | ||||||
| 	const pluginArray = Object.values(pluginMap); | 	const pluginArray = Object.values(pluginMap); | ||||||
|  |  | ||||||
| 	pluginArray.sort((a, b) => { | 	pluginArray.sort((a, b) => { | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user