diff --git a/custom_components/hacs/operational/setup.py b/custom_components/hacs/operational/setup.py index 783b7b06420..ad1d60a3931 100644 --- a/custom_components/hacs/operational/setup.py +++ b/custom_components/hacs/operational/setup.py @@ -108,11 +108,6 @@ async def async_startup_wrapper_for_yaml(): startup_result = False if not startup_result: hacs.system.disabled = True - hacs.hass.components.frontend.async_remove_panel( - hacs.configuration.sidepanel_title.lower() - .replace(" ", "_") - .replace("-", "_") - ) hacs.log.info("Could not setup HACS, trying again in 15 min") async_call_later(hacs.hass, 900, async_startup_wrapper_for_yaml) return diff --git a/custom_components/hacs/operational/setup_actions/frontend.py b/custom_components/hacs/operational/setup_actions/frontend.py index f5950ed3ed6..9433f1c7371 100644 --- a/custom_components/hacs/operational/setup_actions/frontend.py +++ b/custom_components/hacs/operational/setup_actions/frontend.py @@ -26,21 +26,18 @@ async def async_setup_frontend(): # Add to sidepanel if "hacs" not in hacs.hass.data.get("frontend_panels", {}): - custom_panel_config = { - "name": "hacs-frontend", - "embed_iframe": True, - "trust_external": False, - "js_url": "/hacsfiles/frontend/entrypoint.js", - } - - config = {} - config["_panel_custom"] = custom_panel_config - hacs.hass.components.frontend.async_register_built_in_panel( component_name="custom", sidebar_title=hacs.configuration.sidepanel_title, sidebar_icon=hacs.configuration.sidepanel_icon, frontend_url_path="hacs", - config=config, + config={ + "_panel_custom": { + "name": "hacs-frontend", + "embed_iframe": True, + "trust_external": False, + "js_url": "/hacsfiles/frontend/entrypoint.js", + } + }, require_admin=True, ) diff --git a/custom_components/hacs/webresponses/frontend.py b/custom_components/hacs/webresponses/frontend.py index 3dfa2bd8fa9..e019ed1a7fd 100644 --- a/custom_components/hacs/webresponses/frontend.py +++ b/custom_components/hacs/webresponses/frontend.py @@ -42,9 +42,9 @@ async def async_serve_frontend(requested_file): return web.Response(status=404) response = web.FileResponse(servefile) + response.headers["Content-Type"] = "application/javascript" if dev: - response.headers["Content-Type"] = "application/javascript" response.headers["Cache-Control"] = "no-store, max-age=0" response.headers["Pragma"] = "no-store" return response