diff --git a/.eslintrc.json b/.eslintrc.json index 407ef663dd..8527576da2 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -29,6 +29,7 @@ "__BUILD__": false, "__VERSION__": false, "__STATIC_PATH__": false, + "__SUPERVISOR__": false, "Polymer": true }, "env": { diff --git a/build-scripts/bundle.js b/build-scripts/bundle.js index 5402abc16f..277fa54bee 100644 --- a/build-scripts/bundle.js +++ b/build-scripts/bundle.js @@ -35,6 +35,7 @@ module.exports.definedVars = ({ isProdBuild, latestBuild, defineOverlay }) => ({ __BUILD__: JSON.stringify(latestBuild ? "latest" : "es5"), __VERSION__: JSON.stringify(env.version()), __DEMO__: false, + __SUPERVISOR__: false, __BACKWARDS_COMPAT__: false, __STATIC_PATH__: "/static/", "process.env.NODE_ENV": JSON.stringify( @@ -194,6 +195,9 @@ module.exports.config = { publicPath: publicPath(latestBuild, paths.hassio_publicPath), isProdBuild, latestBuild, + defineOverlay: { + __SUPERVISOR__: true, + }, }; }, diff --git a/src/components/ha-icon.ts b/src/components/ha-icon.ts index 59bb2488c8..2c829299b4 100644 --- a/src/components/ha-icon.ts +++ b/src/components/ha-icon.ts @@ -361,7 +361,10 @@ const mdiDeprecatedIcons: DeprecatedIcon = { const chunks: Chunks = {}; -checkCacheVersion(); +// Supervisor doesn't use icons, and should not update/downgrade the icon DB. +if (!__SUPERVISOR__) { + checkCacheVersion(); +} const debouncedWriteCache = debounce(() => writeCache(chunks), 2000); diff --git a/src/types.ts b/src/types.ts index 5d25b7bc8e..539dcb610d 100644 --- a/src/types.ts +++ b/src/types.ts @@ -21,6 +21,7 @@ declare global { var __VERSION__: string; var __STATIC_PATH__: string; var __BACKWARDS_COMPAT__: boolean; + var __SUPERVISOR__: boolean; /* eslint-enable no-var, no-redeclare */ interface Window {