]> git.proxmox.com Git - pmg-gui.git/commitdiff
spam quarantine: avoid full store reload on single-element actions
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 23 Mar 2021 11:21:53 +0000 (12:21 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 23 Mar 2021 11:26:03 +0000 (12:26 +0100)
A store load may require several seconds to complete, which can get
frustrating fast.

For single actions we have a callback which gets only executed on a
successful API call, so we can just remove the entry there directly
from the in-memory store.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
js/SpamQuarantine.js

index b0cfd436b6bd1c04e7da43bae8cdcd750728025e..c5bd5a9cc7a3c58f71d33764874a09a1f29616d7 100644 (file)
@@ -161,7 +161,8 @@ Ext.define('PMG.SpamQuarantine', {
            }
 
            PMG.Utils.doQuarantineAction(action, selected[0].data.id, function() {
-               list.getController().load();
+               // success -> remove directly to avoid slow store reload for a single-element action
+               list.getStore().remove(selected[0]);
            });
        },