]> git.proxmox.com Git - proxmox-widget-toolkit.git/commitdiff
fix updateStore destroy
authorDominik Csapak <d.csapak@proxmox.com>
Wed, 11 Oct 2017 09:31:07 +0000 (11:31 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Wed, 11 Oct 2017 09:46:29 +0000 (11:46 +0200)
the store never fires/gets a destroy event, thus it
never stops the load_task and never unqueues itself in case
the store gets destroyed but not explicitely stopped

with overriding the destroy method, this works now as intended

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
data/UpdateStore.js

index cc30bc36fd6bf8170a33d7967eab349066580981..4368835637e6b5ba545930d237ab76e00de9d143 100644 (file)
@@ -15,6 +15,13 @@ Ext.define('Proxmox.data.UpdateStore', {
 
     autoStart: false,
 
+    destroy: function() {
+       var me = this;
+       me.load_task.cancel();
+       Proxmox.data.UpdateQueue.unqueue(me);
+       me.callParent();
+    },
+
     constructor: function(config) {
        var me = this;
 
@@ -59,10 +66,7 @@ Ext.define('Proxmox.data.UpdateStore', {
 
        me.callParent([config]);
 
-       me.on('destroy', function() {
-           load_task.cancel();
-           Proxmox.data.UpdateQueue.unqueue(me);
-       });
+       me.load_task = load_task;
 
        if (me.autoStart) {
            me.startUpdate();