Skip to content

Commit

Permalink
Ensure defined dynamicActions object
Browse files Browse the repository at this point in the history
  • Loading branch information
cqliu1 committed Nov 14, 2024
1 parent 58f9556 commit e76c295
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export class FlyoutEditDrilldownAction implements Action<EmbeddableApiContext> {

public async isCompatible({ embeddable }: EmbeddableApiContext) {
if (!isApiCompatible(embeddable) || getInheritedViewMode(embeddable) !== 'edit') return false;
return (embeddable.dynamicActionsState$.getValue()?.dynamicActions?.events ?? []).length > 0;
return (embeddable.dynamicActionsState$.getValue()?.dynamicActions.events ?? []).length > 0;
}

public async execute({ embeddable }: EmbeddableApiContext) {
Expand Down
4 changes: 2 additions & 2 deletions x-pack/plugins/embeddable_enhanced/public/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,8 @@ export class EmbeddableEnhancedPlugin
);
const api: DynamicActionStorageApi = {
dynamicActionsState$,
setDynamicActions: (newState) => {
dynamicActionsState$.next(newState);
setDynamicActions: (enhancements) => {
dynamicActionsState$.next(getDynamicActionsState(enhancements));
},
};
const storage = new DynamicActionStorage(uuid, getTitle, api);
Expand Down

0 comments on commit e76c295

Please sign in to comment.