Skip to content

Commit

Permalink
Fix the broken editor after the Google Cast commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Clooos authored Aug 16, 2024
1 parent 9b8e383 commit bf228cc
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 39 deletions.
64 changes: 32 additions & 32 deletions dist/bubble-card.js

Large diffs are not rendered by default.

18 changes: 11 additions & 7 deletions src/editor/bubble-card-editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,18 @@ import {
getIcon
} from '../tools/utils.ts';

let LitElement, html, css;

export function createBubbleCardEditor() {
try {
const LitElement = Object.getPrototypeOf(customElements.get("ha-panel-lovelace"));
const html = LitElement.prototype?.html;
const css = LitElement.prototype?.css;
} catch (error) {
console.error(error.message);
return;
if (!LitElement) {
try {
LitElement = Object.getPrototypeOf(customElements.get("ha-panel-lovelace"));
html = LitElement.prototype?.html;
css = LitElement.prototype?.css;
} catch (error) {
console.error(error.message);
return;
}
}

class BubbleCardEditor extends LitElement {
Expand Down

0 comments on commit bf228cc

Please sign in to comment.