Skip to content

Commit

Permalink
fix deprecated action keys checks to also check that actions are not …
Browse files Browse the repository at this point in the history
…undefined
  • Loading branch information
Nerwyn committed Jul 19, 2024
1 parent 5f1e566 commit d8cb9e0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion dist/android-tv-card.min.js

Large diffs are not rendered by default.

8 changes: 3 additions & 5 deletions src/android-tv-card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -239,10 +239,8 @@ class AndroidTVCard extends LitElement {
'momentary_end_action',
];
for (const actionType of actionTypes) {
if (actionType in customAction) {
const action = customAction[
actionType as keyof IActions
] as IAction;
if (customAction[actionType]) {
const action = customAction[actionType] as IAction;

// Populate action field
if (!customAction.template && !action.action) {
Expand Down Expand Up @@ -271,7 +269,7 @@ class AndroidTVCard extends LitElement {
// Merge service_data, target, and data fields
if (
['data', 'target', 'service_data'].some(
(key) => key in action,
(key) => action[key as keyof IAction],
)
) {
action.data = {
Expand Down

0 comments on commit d8cb9e0

Please sign in to comment.