admin/plugins: Fix UI in case of missed finished:uninstall event
parent
de34e95813
commit
3c39f801fa
|
@ -211,11 +211,26 @@ $(document).ready(() => {
|
||||||
// filter out epl
|
// filter out epl
|
||||||
installed.list = installed.list.filter((plugin) => plugin.name !== 'ep_etherpad-lite');
|
installed.list = installed.list.filter((plugin) => plugin.name !== 'ep_etherpad-lite');
|
||||||
|
|
||||||
// remove all installed plugins (leave plugins that are still being installed)
|
// Remove plugins from the list - they will be added later.
|
||||||
|
// Installed.list contains a list of plugins the server has successfully installed
|
||||||
|
// At this point plugins are ignored if:
|
||||||
|
// - they are being installed (as installed.list does not contain them yet)
|
||||||
|
// - they have been uninstalled (as installed.list does not contain them anymore)
|
||||||
installed.list.forEach((plugin) => {
|
installed.list.forEach((plugin) => {
|
||||||
$(`#installed-plugins .${plugin.name}`).remove();
|
$(`#installed-plugins .${plugin.name}`).remove();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Remove outdated entries
|
||||||
|
const installedItems = $('#installed-plugins tr');
|
||||||
|
installedItems.each(function () {
|
||||||
|
const pluginName = $(this).attr('class');
|
||||||
|
const message = $(this).find('.progress .message').text();
|
||||||
|
// In case the finished:uninstall msg was missed, remove the plugin from the list
|
||||||
|
if (message === 'Uninstalling') {
|
||||||
|
$(`#installed-plugins .${pluginName}`).remove();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
if (installed.list.length > 0) {
|
if (installed.list.length > 0) {
|
||||||
displayPluginList(installed.list, $('#installed-plugins'), $('#installed-plugin-template'));
|
displayPluginList(installed.list, $('#installed-plugins'), $('#installed-plugin-template'));
|
||||||
window.console.log('before emit checkUpdates', new Date())
|
window.console.log('before emit checkUpdates', new Date())
|
||||||
|
|
Loading…
Reference in New Issue