mirror of
https://github.com/discourse/discourse.git
synced 2025-05-25 00:32:52 +08:00
FIX: Always return the latest API version requested
This commit is contained in:
@ -361,6 +361,11 @@ function getPluginApi(version) {
|
||||
if (!_pluginv01) {
|
||||
_pluginv01 = new PluginApi(version, Discourse.__container__);
|
||||
}
|
||||
|
||||
// We are recycling the compatible object, but let's update to the higher version
|
||||
if (_pluginv01.version < version) {
|
||||
_pluginv01.version = version;
|
||||
}
|
||||
return _pluginv01;
|
||||
} else {
|
||||
console.warn(`Plugin API v${version} is not supported`);
|
||||
|
Reference in New Issue
Block a user