Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Dashboard] Fix bugs on removing pinned global filters on dashboard page #5143

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,17 @@

subscriptions.add(stopSyncingFromTimeFilters);

const stopSyncingFromGlobalFilters = filterManager.getUpdates$().subscribe(() => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldnt we unsubscribe from this when exiting the hook?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i did unsubscribe by subscriptions.add(stopSyncingFromGlobalFilters); and subscriptions.unsubscribe();

refreshDashboardContainer({

Check warning on line 197 in src/plugins/dashboard/public/application/utils/use/use_dashboard_app_state.tsx

View check run for this annotation

Codecov / codecov/patch

src/plugins/dashboard/public/application/utils/use/use_dashboard_app_state.tsx#L196-L197

Added lines #L196 - L197 were not covered by tests
dashboardServices: services,
dashboardContainer,
savedDashboard: dashboard!,
appStateData: stateContainer.getState(),
});
});

subscriptions.add(stopSyncingFromGlobalFilters);

Check warning on line 205 in src/plugins/dashboard/public/application/utils/use/use_dashboard_app_state.tsx

View check run for this annotation

Codecov / codecov/patch

src/plugins/dashboard/public/application/utils/use/use_dashboard_app_state.tsx#L205

Added line #L205 was not covered by tests

unsubscribeFromDashboardContainer = () => {
stopSyncingDashboardContainerInputs();
stopSyncingDashboardContainerOutputs();
Expand Down
Loading