mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
[maps] fix Maps don't display darktheme when user has dark theme enabled in profile (#158219)
Fixes https://github.com/elastic/kibana/issues/158050 PR updates `getIsDarkMode` to read value from theme$ instead of UiSettings, since UiSettings does not contain profile theming. Part of https://github.com/elastic/kibana/issues/158201 Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
parent
a7c2d09bca
commit
bb1cf6609a
1 changed files with 6 additions and 1 deletions
|
@ -11,6 +11,7 @@ import { MapsEmsPluginPublicStart } from '@kbn/maps-ems-plugin/public';
|
|||
import type { MapsConfigType } from '../config';
|
||||
import type { MapsPluginStartDependencies } from './plugin';
|
||||
|
||||
let isDarkMode = false;
|
||||
let coreStart: CoreStart;
|
||||
let pluginsStart: MapsPluginStartDependencies;
|
||||
let mapsEms: MapsEmsPluginPublicStart;
|
||||
|
@ -20,6 +21,10 @@ export function setStartServices(core: CoreStart, plugins: MapsPluginStartDepend
|
|||
pluginsStart = plugins;
|
||||
mapsEms = plugins.mapsEms;
|
||||
emsSettings = mapsEms.createEMSSettings();
|
||||
|
||||
core.theme.theme$.subscribe(({ darkMode }) => {
|
||||
isDarkMode = darkMode;
|
||||
});
|
||||
}
|
||||
|
||||
let isCloudEnabled = false;
|
||||
|
@ -35,7 +40,7 @@ export const getAutocompleteService = () => pluginsStart.unifiedSearch.autocompl
|
|||
export const getInspector = () => pluginsStart.inspector;
|
||||
export const getFileUpload = () => pluginsStart.fileUpload;
|
||||
export const getUiSettings = () => coreStart.uiSettings;
|
||||
export const getIsDarkMode = () => getUiSettings().get('theme:darkMode', false);
|
||||
export const getIsDarkMode = () => isDarkMode;
|
||||
export const getIndexPatternSelectComponent = () =>
|
||||
pluginsStart.unifiedSearch.ui.IndexPatternSelect;
|
||||
export const getSearchBar = () => pluginsStart.unifiedSearch.ui.SearchBar;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue