mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
[Maps] fix 'New Map' from getting added to recently accessed (#72125)
This commit is contained in:
parent
4278e560ef
commit
d510263666
2 changed files with 5 additions and 6 deletions
|
@ -7,7 +7,7 @@
|
|||
import React from 'react';
|
||||
import { MapsAppView } from '.';
|
||||
import { getMapsSavedObjectLoader } from '../../bootstrap/services/gis_map_saved_object_loader';
|
||||
import { getToasts } from '../../../kibana_services';
|
||||
import { getCoreChrome, getToasts } from '../../../kibana_services';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { Redirect } from 'react-router-dom';
|
||||
|
||||
|
@ -30,6 +30,10 @@ export const LoadMapAndRender = class extends React.Component {
|
|||
try {
|
||||
const savedMap = await getMapsSavedObjectLoader().get(this.props.savedMapId);
|
||||
if (this._isMounted) {
|
||||
getCoreChrome().docTitle.change(savedMap.title);
|
||||
if (this.props.savedMapId) {
|
||||
getCoreChrome().recentlyAccessed.add(savedMap.getFullPath(), savedMap.title, savedMap.id);
|
||||
}
|
||||
this.setState({ savedMap });
|
||||
}
|
||||
} catch (err) {
|
||||
|
|
|
@ -56,11 +56,6 @@ export class MapsAppView extends React.Component {
|
|||
}
|
||||
|
||||
componentDidMount() {
|
||||
const { savedMap } = this.props;
|
||||
|
||||
getCoreChrome().docTitle.change(savedMap.title);
|
||||
getCoreChrome().recentlyAccessed.add(savedMap.getFullPath(), savedMap.title, savedMap.id);
|
||||
|
||||
// Init sync utils
|
||||
// eslint-disable-next-line react-hooks/rules-of-hooks
|
||||
this._globalSyncUnsubscribe = useGlobalStateSyncing();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue