mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-01 19:46:01 +01:00
closes #2808
This commit is contained in:
@@ -144,7 +144,7 @@ define('admin/extend/plugins', function() {
|
||||
socket.emit('admin.plugins.upgrade', {
|
||||
id: pluginID,
|
||||
version: version
|
||||
}, function(err) {
|
||||
}, function(err, isActive) {
|
||||
if (err) {
|
||||
return app.alertError(err.message);
|
||||
}
|
||||
@@ -152,6 +152,18 @@ define('admin/extend/plugins', function() {
|
||||
parent.find('.fa-exclamation-triangle').remove();
|
||||
parent.find('.currentVersion').text(version);
|
||||
btn.remove();
|
||||
if (isActive) {
|
||||
app.alert({
|
||||
alert_id: 'plugin_upgraded',
|
||||
title: 'Plugin Upgraded',
|
||||
message: 'Please reload your NodeBB to fully upgrade this plugin',
|
||||
type: 'warning',
|
||||
timeout: 5000,
|
||||
clickfn: function() {
|
||||
socket.emit('admin.reload');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -113,7 +113,16 @@ module.exports = function(Plugins) {
|
||||
require('npm').load({}, next);
|
||||
},
|
||||
function(res, next) {
|
||||
require('npm').commands.install([id + '@' + (version || 'latest')], next);
|
||||
require('npm').commands.install([id + '@' + (version || 'latest')], function(err, a, b) {
|
||||
next(err);
|
||||
});
|
||||
},
|
||||
function(next) {
|
||||
Plugins.isActive(id, next);
|
||||
},
|
||||
function(isActive, next) {
|
||||
meta.reloadRequired = isActive;
|
||||
next(null, isActive);
|
||||
}
|
||||
], callback);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user