diff --git a/deluge/ui/web/js/deluge-all/FilterPanel.js b/deluge/ui/web/js/deluge-all/FilterPanel.js index c51b99f34..f3a3e11f3 100644 --- a/deluge/ui/web/js/deluge-all/FilterPanel.js +++ b/deluge/ui/web/js/deluge-all/FilterPanel.js @@ -174,7 +174,9 @@ Ext.define('Deluge.FilterPanel', { if (filters[record.getId()]) return; var r = sm.getLastSelected(); store.remove(record); - if (r.id == record.id) { + if (r === undefined) + return; + if (r.getId() == record.getId()) { sm.select(0); } }, this); diff --git a/deluge/ui/web/js/deluge-all/Sidebar.js b/deluge/ui/web/js/deluge-all/Sidebar.js index fa2e376aa..42503bf95 100644 --- a/deluge/ui/web/js/deluge-all/Sidebar.js +++ b/deluge/ui/web/js/deluge-all/Sidebar.js @@ -90,13 +90,9 @@ Ext.define('Deluge.Sidebar', { deluge.ui.update(); } - Ext.defer(function() { - panel.doLayout(); - }, 100); - console.log('switching'); - //if (!sm.hasSelection() && s.count() > 0) { - // sm.select([s.first()]); - //} + if (!sm.hasSelection() && s.count() > 0) { + sm.select([s.first()]); + } }); this.fireEvent('filtercreate', this, panel);