Explorar el Código

Merge pull request #15125 from grafana/15108-page-title-update

Update <title> when navModel is changed
Torkel Ödegaard hace 7 años
padre
commit
af6a7b1f55
Se han modificado 1 ficheros con 2 adiciones y 2 borrados
  1. 2 2
      public/app/core/components/Page/Page.tsx

+ 2 - 2
public/app/core/components/Page/Page.tsx

@@ -9,9 +9,9 @@ import PageHeader from '../PageHeader/PageHeader';
 import Footer from '../Footer/Footer';
 import PageContents from './PageContents';
 import { CustomScrollbar } from '@grafana/ui';
+import { isEqual } from 'lodash';
 
 interface Props {
-  title?: string;
   children: JSX.Element[] | JSX.Element;
   navModel: NavModel;
 }
@@ -28,7 +28,7 @@ class Page extends Component<Props> {
   }
 
   componentDidUpdate(prevProps: Props) {
-    if (prevProps.title !== this.props.title) {
+    if (!isEqual(prevProps.navModel, this.props.navModel)) {
       this.updateTitle();
     }
   }