mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-14 04:46:34 +00:00
Invalidate theme cache when switching demo's (#5305)
* Invalidate theme cache when switching demo's * Move to mock hass
This commit is contained in:
parent
7170f06c08
commit
b9367a33a8
@ -1,4 +1,7 @@
|
|||||||
import { applyThemesOnElement } from "../common/dom/apply_themes_on_element";
|
import {
|
||||||
|
applyThemesOnElement,
|
||||||
|
invalidateThemeCache,
|
||||||
|
} from "../common/dom/apply_themes_on_element";
|
||||||
|
|
||||||
import { demoConfig } from "./demo_config";
|
import { demoConfig } from "./demo_config";
|
||||||
import { demoServices } from "./demo_services";
|
import { demoServices } from "./demo_services";
|
||||||
@ -224,6 +227,7 @@ export const provideHass = (
|
|||||||
(eventListeners[event] || []).forEach((fn) => fn(event));
|
(eventListeners[event] || []).forEach((fn) => fn(event));
|
||||||
},
|
},
|
||||||
mockTheme(theme) {
|
mockTheme(theme) {
|
||||||
|
invalidateThemeCache();
|
||||||
hass().updateHass({
|
hass().updateHass({
|
||||||
selectedTheme: theme ? "mock" : "default",
|
selectedTheme: theme ? "mock" : "default",
|
||||||
themes: {
|
themes: {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user