Skip to content

Commit

Permalink
Fix agents preview reload search
Browse files Browse the repository at this point in the history
  • Loading branch information
juankaromo authored and pablotr9 committed Aug 5, 2019
1 parent df4e8f9 commit 71b5274
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions public/controllers/agent/agents-preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ export class AgentsPreviewController {
name: '',
id: ''
};
this.prevSearch = false;

// Load URL params
if (loc && loc.tab) {
Expand Down Expand Up @@ -107,6 +108,7 @@ export class AgentsPreviewController {
*/
query(query, search) {
this.$scope.$broadcast('wazuhQuery', { query, search });
this.prevSearch = search || false;
}

/**
Expand Down Expand Up @@ -227,9 +229,9 @@ export class AgentsPreviewController {
this.$scope.registerNewAgent = flag;
}

async reloadList() {
reloadList() {
this.refreshAgentsStats();
this.$scope.$broadcast('wazuhSearch', { term: '' });
this.$scope.$broadcast('wazuhSearch', { term: this.prevSearch || '' });
}

async refreshAgentsStats() {
Expand Down

0 comments on commit 71b5274

Please sign in to comment.