mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 09:19:04 -04:00
* cleared add panel in useEffect cleanup function
This commit is contained in:
parent
ddf265f57f
commit
2dca142c90
1 changed files with 8 additions and 1 deletions
|
@ -10,6 +10,7 @@ import { i18n } from '@kbn/i18n';
|
|||
import angular from 'angular';
|
||||
import React, { useCallback, useEffect, useMemo, useState } from 'react';
|
||||
|
||||
import UseUnmount from 'react-use/lib/useUnmount';
|
||||
import { useKibana } from '../../services/kibana_react';
|
||||
import { IndexPattern, SavedQuery, TimefilterContract } from '../../services/data';
|
||||
import {
|
||||
|
@ -114,7 +115,9 @@ export function DashboardTopNav({
|
|||
id || DASHBOARD_PANELS_UNSAVED_ID
|
||||
);
|
||||
}
|
||||
return () => visibleSubscription.unsubscribe();
|
||||
return () => {
|
||||
visibleSubscription.unsubscribe();
|
||||
};
|
||||
}, [chrome, allowByValueEmbeddables, dashboardStateManager, savedDashboard]);
|
||||
|
||||
const addFromLibrary = useCallback(() => {
|
||||
|
@ -458,6 +461,10 @@ export function DashboardTopNav({
|
|||
share,
|
||||
]);
|
||||
|
||||
UseUnmount(() => {
|
||||
clearAddPanel();
|
||||
});
|
||||
|
||||
const getNavBarProps = () => {
|
||||
const shouldShowNavBarComponent = (forceShow: boolean): boolean =>
|
||||
(forceShow || state.chromeIsVisible) && !dashboardStateManager.getFullScreenMode();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue