Skip to content

Commit

Permalink
reset filter for CRUD when namespace changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Rueckstiess committed Jan 3, 2017
1 parent e5b5501 commit fbc8042
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@ const LoadMoreDocumentsStore = Reflux.createStore({
* @param {Object} state - The query state.
*/
onQueryChanged: function(state) {
if (state.query) {
this.filter = state.query;
}
this.filter = state.query || {};
},

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ const ReadPreference = require('mongodb').ReadPreference;
const toNS = require('mongodb-ns');
const Actions = require('../actions');

// const debug = require('debug')('mongodb-compass:crud');

// const debug = require('debug')('mongodb-compass:crud:store');

/**
Expand All @@ -33,6 +31,7 @@ const ResetDocumentListStore = Reflux.createStore({
// listen for namespace changes
NamespaceStore.listen((ns) => {
if (ns && toNS(ns).collection) {
this.filter = {};
this.reset();
}
});
Expand All @@ -49,10 +48,8 @@ const ResetDocumentListStore = Reflux.createStore({
* @param {Object} state - The query state.
*/
onQueryChanged: function(state) {
if (state.query) {
this.filter = state.query;
this.reset();
}
this.filter = state.query || {};
this.reset();
},

/**
Expand Down

0 comments on commit fbc8042

Please sign in to comment.