Skip to content

Commit

Permalink
Improve code
Browse files Browse the repository at this point in the history
  • Loading branch information
kertal committed Jun 30, 2020
1 parent f901759 commit 01435b9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/plugins/discover/public/application/angular/discover.js
Original file line number Diff line number Diff line change
Expand Up @@ -995,7 +995,10 @@ function discoverController(
$scope.indexPattern.popularizeField(columnName, 1);
}
const columns = columnActions.removeColumn($scope.state.columns, columnName);
const sort = $scope.state.sort.filter(s => s[0] !== columnName);
// The state's sort property is an array of [sortByColumn,sortDirection]
const sort = $scope.state.sort.length
? $scope.state.sort.filter((subArr) => subArr[0] !== columnName)
: [];
setAppState({ columns, sort });
};

Expand Down

0 comments on commit 01435b9

Please sign in to comment.