v1.18.x
Barış Soner Uşaklı 10 years ago
parent 607535b37e
commit f7d7cc2610

@ -144,7 +144,7 @@ define('admin/extend/plugins', function() {
socket.emit('admin.plugins.upgrade', { socket.emit('admin.plugins.upgrade', {
id: pluginID, id: pluginID,
version: version version: version
}, function(err) { }, function(err, isActive) {
if (err) { if (err) {
return app.alertError(err.message); return app.alertError(err.message);
} }
@ -152,6 +152,18 @@ define('admin/extend/plugins', function() {
parent.find('.fa-exclamation-triangle').remove(); parent.find('.fa-exclamation-triangle').remove();
parent.find('.currentVersion').text(version); parent.find('.currentVersion').text(version);
btn.remove(); 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); require('npm').load({}, next);
}, },
function(res, 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); ], callback);
} }

Loading…
Cancel
Save