Skip to content

Commit

Permalink
fixing bugs with rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
ppisljar committed Jun 7, 2017
1 parent b09014f commit 96ba1c4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/ui/public/visualize/visualize.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {

uiModules
.get('kibana/directive', ['ngSanitize'])
.directive('visualize', function (Notifier, Private, timefilter) {
.directive('visualize', function (Notifier, Private, timefilter, getAppState) {
const notify = new Notifier({ location: 'Visualize' });
const requestHandlers = Private(RequestHandlersRegistryProvider);
const responseHandlers = Private(ResponseHandlersRegistryProvider);
Expand All @@ -39,6 +39,8 @@ uiModules
$scope.vis.showSpyPanel = $scope.showSpyPanel || false;
$scope.vis.editorMode = $scope.editorMode;

if (!$scope.appState) $scope.appState = getAppState();

const requestHandler = getHandler(requestHandlers, $scope.vis.type.requestHandler);
const responseHandler = getHandler(responseHandlers, $scope.vis.type.responseHandler);

Expand Down Expand Up @@ -79,7 +81,7 @@ uiModules
if ($scope.vis.type.requiresSearch) {
stateMonitor.onChange((status, type, keys) => {
if (['query', 'filters', 'vis'].includes(keys[0])) {
$scope.vis.setState($scope.appState.vis);
if ($scope.appState.vis) $scope.vis.setState($scope.appState.vis);
$scope.fetch();
}
});
Expand Down

0 comments on commit 96ba1c4

Please sign in to comment.