admin/plugins: Fix UI in case of missed finished:uninstall event

fix-admintests-rebased
webzwo0i 2023-07-30 03:35:11 +02:00 committed by SamTV12345
parent de34e95813
commit 3c39f801fa
1 changed files with 16 additions and 1 deletions

View File

@ -211,11 +211,26 @@ $(document).ready(() => {
// filter out epl
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-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) {
displayPluginList(installed.list, $('#installed-plugins'), $('#installed-plugin-template'));
window.console.log('before emit checkUpdates', new Date())