Skip to content

Commit

Permalink
Enable page_data event for fullscreen app widget
Browse files Browse the repository at this point in the history
  • Loading branch information
Artur Fracala committed Oct 11, 2024
1 parent 67928fb commit 3a21a2b
Showing 1 changed file with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
IFullscreenWidgetEvents,
ReportsFilters
} from './interfaces';
import { withPageData } from '../shared/page-data';

export { ReportsFilters } from './interfaces';

Expand All @@ -35,13 +36,17 @@ export function FullscreenWidget(
}
}
);
return withAmplitude(base);
return withAmplitude(withPageData(base));
}

export type IFullscreenWidget = ReturnType<typeof FullscreenWidget>;

export default function createFullscreenWidget(): Promise<IFullscreenWidget> {
return createConnection<IFullscreenWidgetEvents>().then(connection =>
FullscreenWidget(connection)
);
let widget: IFullscreenWidget;
return createConnection<IFullscreenWidgetEvents>()
.then(connection => {
widget = FullscreenWidget(connection);
return connection.sendMessage('plugin_inited');
})
.then(() => widget);
}

0 comments on commit 3a21a2b

Please sign in to comment.