[pve-devel] [PATCH manager v2] fix wrong message after subscription upload

Dominik Csapak d.csapak at proxmox.com
Fri May 20 10:24:04 CEST 2016


since extjs5 Store.snapshot does not exist anymore,
we didnt remove filtered records

this lead to the fact, that the 'message' record did
not get removed and a "no subscription file" message
was shown directly after uploading a key

to get also the filtered records in the store
we use store.getData().getSource()

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 www/manager6/data/DiffStore.js | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/www/manager6/data/DiffStore.js b/www/manager6/data/DiffStore.js
index 4476fe2..db07aa6 100644
--- a/www/manager6/data/DiffStore.js
+++ b/www/manager6/data/DiffStore.js
@@ -73,8 +73,12 @@ Ext.define('PVE.data.DiffStore', {
 
 	    me.suspendEvents();
 
+	    // getSource returns null if data is not filtered
+	    // if it is filtered it returns all records
+	    var allItems = me.getData().getSource() || me.getData();
+
 	    // remove vanished items
-	    (me.snapshot || me.data).each(function(olditem) {
+	    allItems.each(function(olditem) {
 		var item = rstore.getById(olditem.getId());
 		if (!item) {
 		    me.remove(olditem);
-- 
2.1.4





More information about the pve-devel mailing list